snapshot of https://github.com/traggo/server.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
build / build (push) Failing after 3s

This commit is contained in:
upstream-mirror
2026-09-16 05:24:45 +05:00
commit cda7c1a474
272 changed files with 31973 additions and 0 deletions

18
device/remove_current.go Normal file
View File

@@ -0,0 +1,18 @@
package device
import (
"context"
"github.com/jinzhu/copier"
"github.com/traggo/server/auth"
"github.com/traggo/server/generated/gqlmodel"
)
// RemoveCurrentDevice removes the current authenticated device
func (r *ResolverForDevice) RemoveCurrentDevice(ctx context.Context) (*gqlmodel.Device, error) {
device := auth.GetDevice(ctx)
remove := r.DB.Delete(device)
gqlDevice := &gqlmodel.Device{}
copier.Copy(gqlDevice, device)
return gqlDevice, remove.Error
}