({ id, accountId }: { id: string; accountId: string })
| 49 | } |
| 50 | |
| 51 | static async revoke({ id, accountId }: { id: string; accountId: string }) { |
| 52 | const apiKey = await prisma.apiKeys.findUnique({ where: { id } }); |
| 53 | if (!apiKey) { |
| 54 | return { ok: false, data: 'not_found' }; |
| 55 | } |
| 56 | if (apiKey.accountId !== accountId) { |
| 57 | return { ok: false, data: 'account_mismatch' }; |
| 58 | } |
| 59 | await prisma.apiKeys.delete({ where: { id: apiKey.id } }); |
| 60 | return { ok: true }; |
| 61 | } |
| 62 | } |
no test coverage detected