mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge pull request #1004 from appwrite/fix-race-condition-invalidation
fix: functions variable creation race condition invalidation
This commit is contained in:
+3
-6
@@ -24,20 +24,17 @@
|
||||
|
||||
const sdkCreateVariable = async (key: string, value: string) => {
|
||||
await sdk.forProject.functions.createVariable($func.$id, key, value);
|
||||
await invalidate(Dependencies.VARIABLES);
|
||||
await invalidate(Dependencies.FUNCTION);
|
||||
await Promise.all([invalidate(Dependencies.VARIABLES), invalidate(Dependencies.FUNCTION)]);
|
||||
};
|
||||
|
||||
const sdkUpdateVariable = async (variableId: string, key: string, value: string) => {
|
||||
await sdk.forProject.functions.updateVariable($func.$id, variableId, key, value);
|
||||
await invalidate(Dependencies.VARIABLES);
|
||||
await invalidate(Dependencies.FUNCTION);
|
||||
await Promise.all([invalidate(Dependencies.VARIABLES), invalidate(Dependencies.FUNCTION)]);
|
||||
};
|
||||
|
||||
const sdkDeleteVariable = async (variableId: string) => {
|
||||
await sdk.forProject.functions.deleteVariable($func.$id, variableId);
|
||||
await invalidate(Dependencies.VARIABLES);
|
||||
await invalidate(Dependencies.FUNCTION);
|
||||
await Promise.all([invalidate(Dependencies.VARIABLES), invalidate(Dependencies.FUNCTION)]);
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -138,9 +138,11 @@
|
||||
selectedVar = null;
|
||||
showPromoteModal = false;
|
||||
|
||||
await invalidate(Dependencies.FUNCTION);
|
||||
await invalidate(Dependencies.VARIABLES);
|
||||
await invalidate(Dependencies.PROJECT_VARIABLES);
|
||||
await Promise.all([
|
||||
invalidate(Dependencies.FUNCTION),
|
||||
invalidate(Dependencies.VARIABLES),
|
||||
invalidate(Dependencies.PROJECT_VARIABLES)
|
||||
]);
|
||||
|
||||
addNotification({
|
||||
type: 'success',
|
||||
|
||||
Reference in New Issue
Block a user