From 800d688d4cfbb43ae4c18eec7ef5767940383c57 Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Fri, 25 Jul 2025 17:47:44 +0200 Subject: [PATCH] fix: api key mutations invalidate proper keys (#37467) * fix: api key mutations invalidate proper keys * Fix the RQ keys for API keys. --------- Co-authored-by: Ivan Vasilov --- apps/studio/data/api-keys/api-key-create-mutation.ts | 2 +- apps/studio/data/api-keys/keys.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/studio/data/api-keys/api-key-create-mutation.ts b/apps/studio/data/api-keys/api-key-create-mutation.ts index 0cc6b36ec57..f84d56055ec 100644 --- a/apps/studio/data/api-keys/api-key-create-mutation.ts +++ b/apps/studio/data/api-keys/api-key-create-mutation.ts @@ -36,7 +36,7 @@ export async function createAPIKey(payload: APIKeyCreateVariables) { ? { // secret_jwt_template: payload?.secret_jwt_template || null, secret_jwt_template: { - role: 'service_role', // @mildtomato (Jonny) this should be default in API for type secret + role: 'service_role', }, } : name), diff --git a/apps/studio/data/api-keys/keys.ts b/apps/studio/data/api-keys/keys.ts index 222a51b0b1c..e0bfd893264 100644 --- a/apps/studio/data/api-keys/keys.ts +++ b/apps/studio/data/api-keys/keys.ts @@ -1,6 +1,6 @@ export const apiKeysKeys = { list: (projectRef?: string, reveal?: boolean) => - ['projects', projectRef, 'api-keys', reveal] as const, + ['projects', projectRef, 'api-keys', reveal].filter(Boolean), single: (projectRef?: string, id?: string) => ['projects', projectRef, 'api-keys', id] as const, status: (projectRef?: string) => ['projects', projectRef, 'api-keys', 'legacy'] as const, }