@fy-/fws-vue 0.4.4 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,14 @@ const rest = useRest();
9
9
  const userStore = useUserStore();
10
10
  const userData = computed(() => userStore.user);
11
11
  const eventBus = useEventBus();
12
+ const props = withDefaults(
13
+ defineProps<{
14
+ onCompleted?: (data: any) => void;
15
+ }>(),
16
+ {
17
+ onCompleted: () => {},
18
+ },
19
+ );
12
20
  const state = reactive({
13
21
  userData: {
14
22
  Firstname: userData.value?.Firstname || "",
@@ -53,6 +61,9 @@ const patchUser = async () => {
53
61
  const response = await rest("User", "PATCH", state.userData);
54
62
  if (response && response.result == "success") {
55
63
  eventBus.emit("user:refresh", true);
64
+ if (props.onCompleted) {
65
+ props.onCompleted(response);
66
+ }
56
67
  }
57
68
  }
58
69
  eventBus.emit("main-loading", false);
@@ -108,6 +108,9 @@ async function getCropResult() {
108
108
  uploader.value.addFile(file);
109
109
  }
110
110
  const fileUploadCallback = (response: any) => {
111
+ if (props.onCompleted) {
112
+ props.onCompleted(response);
113
+ }
111
114
  eventBus.emit("avCropModal", false);
112
115
  eventBus.emit("main-loading", false);
113
116
  eventBus.emit("user:refresh", true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fy-/fws-vue",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "author": "Florian 'Fy' Gasquez <m@fy.to>",
5
5
  "license": "MIT",
6
6
  "repository": {