MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / revokeApiKey

Method revokeApiKey

frontend/src/api.js:3411–3436  ·  view source on GitHub ↗
({ user_id = null } = {})

Source from the content-addressed store, hash-verified

3409 }
3410
3411 static async revokeApiKey({ user_id = null } = {}) {
3412 try {
3413 const body = {};
3414 if (user_id) {
3415 body.user_id = user_id;
3416 }
3417
3418 const response = await request(`${host}/api/accounts/api-keys/revoke/`, {
3419 method: 'POST',
3420 body,
3421 });
3422
3423 // If the backend returned an updated user, refresh the users store
3424 try {
3425 if (response && response.user) {
3426 useUsersStore.getState().updateUser(response.user);
3427 }
3428 } catch (e) {
3429 // ignore store update errors
3430 }
3431
3432 return response;
3433 } catch (e) {
3434 errorNotification('Failed to revoke API key', e);
3435 }
3436 }
3437
3438 static async updateUser(id, body, self = false) {
3439 try {

Callers 1

revokeApiKeyFunction · 0.80

Calls 3

requestFunction · 0.85
errorNotificationFunction · 0.85
updateUserMethod · 0.80

Tested by

no test coverage detected