Make personal access tokens soft-deletable; update front-end

This commit is contained in:
Dane Everitt
2022-02-20 13:07:12 -05:00
parent 4cbdaa6699
commit cb4d4b5ce6
13 changed files with 184 additions and 133 deletions
@@ -0,0 +1,12 @@
import { useStoreState } from '@/state/hooks';
export default (context: string | string[]) => {
const key = Array.isArray(context) ? context.join(':') : context;
const uuid = useStoreState(state => state.user.data?.uuid);
if (!key.trim().length) {
throw new Error('Must provide a valid context key to "useUserSWRContextKey".');
}
return `swr::${uuid || 'unknown'}:${key.trim()}`;
};