Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
nakasyou authored Oct 1, 2023
1 parent 5b90f61 commit b51b406
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions routes/admin/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,23 @@ export const handler: Handlers<User | null> = {
})
break
}
case 'rename_school': {
// Rename School
await kv.set(['schools', data.schoolId], {
schoolId,
schoolName: data.newName,
})
return jsonResp({
status: 'ok',
})
}
case 'remove_school': {
// Rename School
await kv.delete(['schools', data.id])
return jsonResp({
status: 'ok',
})
}
}
return new Response('400 Bad Request', {
status: '400',
Expand Down

0 comments on commit b51b406

Please sign in to comment.