@iservice365/layer-common 1.0.6 → 1.0.7
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/components/InvitationForm.vue +5 -2
- package/composables/useUser.ts +8 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -156,13 +156,18 @@ const props = defineProps({
|
|
|
156
156
|
const emit = defineEmits(["cancel", "success", "success:create-more"]);
|
|
157
157
|
|
|
158
158
|
const validForm = ref(false);
|
|
159
|
+
const app = computed(() => useRuntimeConfig().public.APP ?? "");
|
|
159
160
|
|
|
160
161
|
const invite = ref<Record<string, any>>({
|
|
161
162
|
email: "",
|
|
162
163
|
app: "organization",
|
|
163
164
|
role: "",
|
|
165
|
+
org: "",
|
|
164
166
|
});
|
|
165
167
|
|
|
168
|
+
invite.value.app = app.value ?? "organization";
|
|
169
|
+
invite.value.org = props.org ?? "";
|
|
170
|
+
|
|
166
171
|
if (props.mode === "edit") {
|
|
167
172
|
invite.value.email = props.invite.email;
|
|
168
173
|
invite.value.app = props.invite.metadata?.app;
|
|
@@ -181,8 +186,6 @@ const roles = ref<Array<Record<string, any>>>([]);
|
|
|
181
186
|
|
|
182
187
|
const { getRoles } = useRole();
|
|
183
188
|
|
|
184
|
-
const app = computed(() => invite.value.metadata?.app ?? "");
|
|
185
|
-
|
|
186
189
|
const { data: RolesData } = await useLazyAsyncData(
|
|
187
190
|
"get-roles-by-type",
|
|
188
191
|
() => getRoles({ org: props.org, type: app.value, limit: 50 }),
|
package/composables/useUser.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
export default function useUser() {
|
|
2
|
-
function inviteUser({
|
|
2
|
+
function inviteUser({
|
|
3
|
+
email = "",
|
|
4
|
+
app = "",
|
|
5
|
+
role = "",
|
|
6
|
+
name = "",
|
|
7
|
+
org = "",
|
|
8
|
+
} = {}) {
|
|
3
9
|
return useNuxtApp().$api<Record<string, any>>("/api/auth/invite", {
|
|
4
10
|
method: "POST",
|
|
5
|
-
body: { email, app, role, name },
|
|
11
|
+
body: { email, app, role, name, org },
|
|
6
12
|
});
|
|
7
13
|
}
|
|
8
14
|
|