@goweekdays/layer-common 1.5.7 → 1.5.8
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.
- package/CHANGELOG.md +6 -0
- package/composables/useOrg.ts +12 -0
- package/composables/useVerification.ts +21 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/composables/useOrg.ts
CHANGED
|
@@ -10,6 +10,17 @@ export default function useOrg() {
|
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
function addPilot(
|
|
14
|
+
value: Pick<TOrg, "name" | "email" | "contact" | "createdBy"> & {
|
|
15
|
+
verificationCode: string;
|
|
16
|
+
}
|
|
17
|
+
) {
|
|
18
|
+
return useNuxtApp().$api<Record<string, any>>("/api/organizations/pilot", {
|
|
19
|
+
method: "POST",
|
|
20
|
+
body: value,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
13
24
|
function getAll({ page = 1, search = "", limit = 20, status = "" } = {}) {
|
|
14
25
|
return useNuxtApp().$api<Record<string, any>>("/api/organizations", {
|
|
15
26
|
method: "GET",
|
|
@@ -78,6 +89,7 @@ export default function useOrg() {
|
|
|
78
89
|
return {
|
|
79
90
|
org,
|
|
80
91
|
add,
|
|
92
|
+
addPilot,
|
|
81
93
|
getAll,
|
|
82
94
|
getByUserId,
|
|
83
95
|
getById,
|
|
@@ -57,11 +57,32 @@ export default function useUser() {
|
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
function inviteOrg(email: string, pilot?: boolean) {
|
|
61
|
+
return useNuxtApp().$api<Record<string, any>>(
|
|
62
|
+
"/api/verifications/org/invite",
|
|
63
|
+
{
|
|
64
|
+
method: "POST",
|
|
65
|
+
body: { email, pilot },
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function verify(id: string) {
|
|
71
|
+
return useNuxtApp().$api<Record<string, any>>(
|
|
72
|
+
`/api/verifications/verify/${id}`,
|
|
73
|
+
{
|
|
74
|
+
method: "GET",
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
60
79
|
return {
|
|
61
80
|
getVerifications,
|
|
62
81
|
inviteMember,
|
|
63
82
|
signUp,
|
|
64
83
|
cancelInvite,
|
|
65
84
|
orgSetupFee,
|
|
85
|
+
inviteOrg,
|
|
86
|
+
verify,
|
|
66
87
|
};
|
|
67
88
|
}
|