A decentralized music tracking and discovery platform built on AT Protocol 🎵 rocksky.app
spotify atproto lastfm musicbrainz scrobbling listenbrainz
99
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(web): refresh apikeys list after create/delete

+29 -9
+29 -9
apps/web/src/pages/apikeys/ApiKeys.tsx
··· 57 57 58 58 const values = getValues(); 59 59 60 - await createApiKey({ name: values.name, description: values.description }); 60 + await createApiKey( 61 + { name: values.name, description: values.description }, 62 + { 63 + onSuccess: async () => { 64 + apiKeys = await apiKeys.refetch(); 65 + }, 66 + } 67 + ); 61 68 62 69 setIsOpen(false); 63 70 clearErrors(); 64 71 reset(); 65 - 66 - apiKeys = await apiKeys.refetch(); 67 72 }; 68 73 69 74 const onDisable = async (id: string) => { ··· 71 76 ...prev, 72 77 [id]: false, 73 78 })); 74 - await updateApiKey({ id, enabled: false }); 75 - apiKeys = await apiKeys.refetch(); 79 + await updateApiKey( 80 + { id, enabled: false }, 81 + { 82 + onSuccess: async () => { 83 + apiKeys = await apiKeys.refetch(); 84 + }, 85 + } 86 + ); 76 87 }; 77 88 78 89 const onEnable = async (id: string) => { ··· 80 91 ...prev, 81 92 [id]: true, 82 93 })); 83 - await updateApiKey({ id, enabled: true }); 84 - apiKeys = await apiKeys.refetch(); 94 + await updateApiKey( 95 + { id, enabled: true }, 96 + { 97 + onSuccess: async () => { 98 + apiKeys = await apiKeys.refetch(); 99 + }, 100 + } 101 + ); 85 102 }; 86 103 87 104 const onDelete = async (id: string) => { 88 - await deleteApiKey(id); 89 - apiKeys = await apiKeys.refetch(); 105 + await deleteApiKey(id, { 106 + onSuccess: async () => { 107 + apiKeys = await apiKeys.refetch(); 108 + }, 109 + }); 90 110 }; 91 111 92 112 if (!jwt) {