@gigamusic/admin 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/handlers/releases.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gigamusic/admin",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Server-only admin API handler factories for the gigamusic platform (releases CRUD, tracks, uploads, settings, links, orders).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"zod": "^3.24.1",
|
|
27
27
|
"@gigamusic/audio": "1.0.0",
|
|
28
|
+
"@gigamusic/db": "2.0.1",
|
|
28
29
|
"@gigamusic/core": "1.0.0",
|
|
29
|
-
"@gigamusic/storage": "1.0.0"
|
|
30
|
-
"@gigamusic/db": "2.0.1"
|
|
30
|
+
"@gigamusic/storage": "1.0.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^22.10.5",
|
package/src/handlers/releases.ts
CHANGED
|
@@ -181,10 +181,11 @@ function collectStorageKeys(
|
|
|
181
181
|
return keys;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
+
/** Postgres SQLSTATE 23505 — unique_violation. */
|
|
184
185
|
function isUniqueConstraintError(err: unknown): boolean {
|
|
185
186
|
if (typeof err !== "object" || err === null) return false;
|
|
186
187
|
const code = (err as { code?: unknown }).code;
|
|
187
|
-
if (code === "
|
|
188
|
+
if (code === "23505") return true;
|
|
188
189
|
// Some Queries implementations may surface plain Errors with this prefix.
|
|
189
190
|
const message = (err as { message?: unknown }).message;
|
|
190
191
|
return typeof message === "string" && /slug.*(already|exists|unique)/i.test(message);
|