mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 20:37:21 +00:00
finalize new media settings
This commit is contained in:
@@ -14,6 +14,7 @@ type BkndContext = {
|
||||
config: ModuleConfigs;
|
||||
permissions: string[];
|
||||
hasSecrets: boolean;
|
||||
fetched: boolean;
|
||||
requireSecrets: () => Promise<void>;
|
||||
actions: ReturnType<typeof getSchemaActions>;
|
||||
app: AppReduced;
|
||||
@@ -103,7 +104,7 @@ export function BkndProvider({
|
||||
|
||||
return (
|
||||
<BkndContext.Provider
|
||||
value={{ ...schema, actions, requireSecrets, app, adminOverride, hasSecrets }}
|
||||
value={{ ...schema, fetched, actions, requireSecrets, app, adminOverride, hasSecrets }}
|
||||
key={local_version}
|
||||
>
|
||||
{/*{error && (
|
||||
|
||||
@@ -1,26 +1,15 @@
|
||||
import type { TAppMediaConfig } from "media/media-schema";
|
||||
import { useBknd } from "ui/client/BkndProvider";
|
||||
|
||||
export function useBkndMedia() {
|
||||
const { config, schema, actions: bkndActions } = useBknd();
|
||||
|
||||
const actions = {
|
||||
/*roles: {
|
||||
add: async (name: string, data: any = {}) => {
|
||||
console.log("add role", name, data);
|
||||
return await bkndActions.add("auth", `roles.${name}`, data);
|
||||
},
|
||||
patch: async (name: string, data: any) => {
|
||||
console.log("patch role", name, data);
|
||||
return await bkndActions.patch("auth", `roles.${name}`, data);
|
||||
},
|
||||
delete: async (name: string) => {
|
||||
console.log("delete role", name);
|
||||
if (window.confirm(`Are you sure you want to delete the role "${name}"?`)) {
|
||||
return await bkndActions.remove("auth", `roles.${name}`);
|
||||
}
|
||||
return false;
|
||||
config: {
|
||||
patch: async (data: Partial<TAppMediaConfig>) => {
|
||||
return await bkndActions.set("media", data, true);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
};
|
||||
const $media = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user