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.
@@ -197,13 +197,17 @@ export async function handler(
197
197
  .select();
198
198
  break;
199
199
  case "changeBadges":
200
- result = await supabase
201
- .from("profiles")
202
- .upsert({
203
- id: params.userId,
204
- badges: JSON.parse(params.badges),
205
- })
206
- .select();
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rhythia-api",
3
- "version": "202.0.0",
3
+ "version": "203.0.0",
4
4
  "main": "index.ts",
5
5
  "author": "online-contributors-cunev",
6
6
  "scripts": {