rhythia-api 202.0.0 → 203.0.0
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/api/executeAdminOperation.ts +11 -7
- package/package.json +1 -1
|
@@ -197,13 +197,17 @@ export async function handler(
|
|
|
197
197
|
.select();
|
|
198
198
|
break;
|
|
199
199
|
case "changeBadges":
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
200
|
+
// Allow only developers to modify badges.
|
|
201
|
+
if ((queryUserData.badges as string[]).includes("Developer")) {
|
|
202
|
+
result = await supabase
|
|
203
|
+
.from("profiles")
|
|
204
|
+
.upsert({
|
|
205
|
+
id: params.userId,
|
|
206
|
+
badges: JSON.parse(params.badges),
|
|
207
|
+
})
|
|
208
|
+
.select();
|
|
209
|
+
}
|
|
210
|
+
|
|
207
211
|
break;
|
|
208
212
|
}
|
|
209
213
|
|