From e8a027ca12fafd9cf298b37259d19eded6bc1b92 Mon Sep 17 00:00:00 2001 From: Tigor Hutasuhut Date: Wed, 24 Apr 2024 22:00:15 +0700 Subject: [PATCH] fix(device-update): err check now uses ErrConstraint --- api/devices_update.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/devices_update.go b/api/devices_update.go index fd38980..4168686 100644 --- a/api/devices_update.go +++ b/api/devices_update.go @@ -17,7 +17,7 @@ func (api *API) DevicesUpdate(ctx context.Context, id int, update *models.Device if err != nil { var sqliteErr sqlite3.Error if errors.As(err, &sqliteErr) { - if sqliteErr.Code == sqlite3.ErrNo(sqlite3.ErrConstraintUnique) { + if sqliteErr.Code == sqlite3.ErrConstraint { return errs.Wrapw(err, "a device with the same slug id already exists").Code(409) } }