@goweekdays/layer-common 1.5.2 → 1.5.3
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 +13 -0
- package/composables/useUtils.ts +11 -0
- package/composables/useVerification.ts +1 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/composables/useOrg.ts
CHANGED
|
@@ -63,6 +63,18 @@ export default function useOrg() {
|
|
|
63
63
|
promoCode: "",
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
+
function getCompanies(search = "") {
|
|
67
|
+
return useNuxtApp().$api<Record<string, any>[]>(
|
|
68
|
+
"/api/organizations/company",
|
|
69
|
+
{
|
|
70
|
+
method: "GET",
|
|
71
|
+
query: {
|
|
72
|
+
search,
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
66
78
|
return {
|
|
67
79
|
org,
|
|
68
80
|
add,
|
|
@@ -70,5 +82,6 @@ export default function useOrg() {
|
|
|
70
82
|
getByUserId,
|
|
71
83
|
getById,
|
|
72
84
|
updateById,
|
|
85
|
+
getCompanies,
|
|
73
86
|
};
|
|
74
87
|
}
|
package/composables/useUtils.ts
CHANGED
|
@@ -277,6 +277,16 @@ export default function useUtils() {
|
|
|
277
277
|
return (v && v >= 1) || "Value must be greater or equal to 1";
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
+
function getCurrencySymbol(currency: string): string {
|
|
281
|
+
if (!currency) return "";
|
|
282
|
+
return new Intl.NumberFormat(undefined, {
|
|
283
|
+
style: "currency",
|
|
284
|
+
currency,
|
|
285
|
+
})
|
|
286
|
+
.formatToParts(0)
|
|
287
|
+
.find((part) => part.type === "currency")!.value;
|
|
288
|
+
}
|
|
289
|
+
|
|
280
290
|
return {
|
|
281
291
|
requiredRule,
|
|
282
292
|
emailRule,
|
|
@@ -304,5 +314,6 @@ export default function useUtils() {
|
|
|
304
314
|
setRouteParams,
|
|
305
315
|
positiveNumberRule,
|
|
306
316
|
validateKey,
|
|
317
|
+
getCurrencySymbol,
|
|
307
318
|
};
|
|
308
319
|
}
|
|
@@ -46,9 +46,7 @@ export default function useUser() {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
function orgSetupFee(
|
|
49
|
-
value: Pick<TOrg, "name" | "email" | "contact" | "createdBy">
|
|
50
|
-
seats: number;
|
|
51
|
-
}
|
|
49
|
+
value: Pick<TOrg, "name" | "email" | "contact" | "createdBy">
|
|
52
50
|
) {
|
|
53
51
|
return useNuxtApp().$api<Record<string, any>>(
|
|
54
52
|
"/api/verifications/org-setup-fee",
|