Add delete API key (#25)

This commit is contained in:
KM Koushik
2024-05-31 08:21:51 +10:00
committed by GitHub
parent 8b61223153
commit f183905c9f
5 changed files with 161 additions and 15 deletions

View File

@@ -57,3 +57,16 @@ export async function retrieveApiKey(token: string) {
throw error;
}
}
export async function deleteApiKey(id: number) {
try {
await db.apiKey.delete({
where: {
id,
},
});
} catch (error) {
console.error("Error deleting API key:", error);
throw error;
}
}