Started implementing the roles permissions
This commit is contained in:
@@ -44,7 +44,15 @@ export const convertBase64 = (file: File) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const redirect = (destination: string) => ({
|
||||
redirect: {
|
||||
destination: destination,
|
||||
permanent: false,
|
||||
},
|
||||
})
|
||||
|
||||
export const mapBy = <T, K extends keyof T>(obj: T[] | undefined, key: K) => (obj || []).map((i) => i[key] as T[K]);
|
||||
export const filterBy = <T>(obj: T[], key: keyof T, value: any) => obj.filter((i) => i[key] === value);
|
||||
export const findBy = <T>(obj: T[], key: keyof T, value: any) => obj.find((i) => i[key] === value);
|
||||
|
||||
export const serialize = <T>(obj: T): T => JSON.parse(JSON.stringify(obj));
|
||||
|
||||
Reference in New Issue
Block a user