mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
feat: improve create function store
This commit is contained in:
@@ -52,13 +52,7 @@
|
||||
}
|
||||
|
||||
function resetState() {
|
||||
createFunction.set({
|
||||
$id: null,
|
||||
name: null,
|
||||
entrypoint: null,
|
||||
execute: [],
|
||||
runtime: null
|
||||
});
|
||||
createFunction.reset();
|
||||
choices.set({
|
||||
branch: null,
|
||||
silentMode: false,
|
||||
|
||||
@@ -31,13 +31,29 @@ export const installations = derived(
|
||||
($page) => $page.data.installations as Models.InstallationList
|
||||
);
|
||||
|
||||
export const createFunction = writable<Partial<Models.Function>>({
|
||||
const initialCreateFunction: Partial<Models.Function> = {
|
||||
$id: null,
|
||||
name: null,
|
||||
entrypoint: null,
|
||||
execute: [],
|
||||
runtime: null,
|
||||
commands: null
|
||||
});
|
||||
};
|
||||
|
||||
function createFunctionStore() {
|
||||
const store = writable<Partial<Models.Function>>({
|
||||
...initialCreateFunction
|
||||
});
|
||||
|
||||
const reset = () => {
|
||||
store.set({ ...initialCreateFunction });
|
||||
};
|
||||
|
||||
return {
|
||||
...store,
|
||||
reset
|
||||
};
|
||||
}
|
||||
export const createFunction = createFunctionStore();
|
||||
|
||||
export const createFunctionDeployment = writable<FileList>();
|
||||
|
||||
Reference in New Issue
Block a user