finalize new media settings

This commit is contained in:
dswbx
2025-02-05 17:54:48 +01:00
parent 8418231c43
commit 46cf310ad6
12 changed files with 102 additions and 86 deletions

View File

@@ -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 && (

View File

@@ -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 = {};