-
-
-
+
@@ -158,8 +158,8 @@ import { api } from 'boot/axios';
const columns = [
{ name: 'id', label: 'ID', field: 'id', align: 'left', sortable: true },
- { name: 'firstName', label: '氏名', field: 'firstName', align: 'left', sortable: true },
- { name: 'lastName', label: '苗字', field: 'lastName', align: 'left', sortable: true },
+ { name: 'lastName', label: '氏名', field: 'lastName', align: 'left', sortable: true },
+ { name: 'firstName', label: '苗字', field: 'firstName', align: 'left', sortable: true },
{ name: 'email', label: '電子メール', field: 'email', align: 'left', sortable: true },
{ name: 'status', label: '状況', field: 'status', align: 'left' },
{ name: 'actions', label: '操作', field: 'actions' }
@@ -168,6 +168,7 @@ const columns = [
const pagination = ref({ sortBy: 'id', descending: true, rowsPerPage: 20 });
const loading = ref(false);
+const addEditLoading = ref(false);
const filter = ref('');
const statusFilter = ref('全データ');
const rows = ref([]);
@@ -189,7 +190,7 @@ let editId = ref(0);
const getUsers = async (filter = () => true) => {
loading.value = true;
const result = await api.get(`api/v1/users`);
- rows.value = result.data.map((item) => {
+ rows.value = result.data.data.map((item) => {
return { id: item.id, firstName: item.first_name, lastName: item.last_name, email: item.email, isSuperuser: item.is_superuser, isActive: item.is_active }
}).filter(filter);
loading.value = false;
@@ -260,6 +261,7 @@ const closeDg = () => {
}
const onSubmit = () => {
+ addEditLoading.value = true;
if (editId.value !== 0) {
api.put(`api/v1/users/${editId.value}`, {
'first_name': firstName.value,
@@ -302,6 +304,7 @@ const onReset = () => {
isPwd.value = true;
editId.value = 0;
isCreate.value = true;
- resetPsw.value = false
+ resetPsw.value = false;
+ addEditLoading.value = false;
}
diff --git a/frontend/src/stores/useAuthStore.ts b/frontend/src/stores/useAuthStore.ts
index f58028f..8ce4136 100644
--- a/frontend/src/stores/useAuthStore.ts
+++ b/frontend/src/stores/useAuthStore.ts
@@ -68,7 +68,7 @@ export const useAuthStore = defineStore('auth', {
}
},
async getCurrentDomain(): Promise {
- const resp = await api.get(`api/activedomain`);
+ const resp = await api.get(`api/defaultdomain`);
const activedomain = resp?.data?.data;
return {
id: activedomain?.id,
@@ -77,7 +77,7 @@ export const useAuthStore = defineStore('auth', {
};
},
async getUserInfo():Promise{
- const resp = (await api.get(`api/v1/users/me`)).data;
+ const resp = (await api.get(`api/v1/users/me`)).data.data;
return {
firstName: resp.first_name,
lastName: resp.last_name,
@@ -97,7 +97,7 @@ export const useAuthStore = defineStore('auth', {
if (domain.id === this.currentDomain.id) {
return;
}
- await api.put(`api/activedomain/${domain.id}`);
+ await api.put(`api/defaultdomain/${domain.id}`);
this.currentDomain = domain;
},
},
diff --git a/frontend/src/types/DomainTypes.ts b/frontend/src/types/DomainTypes.ts
index 2594450..3f7eafb 100644
--- a/frontend/src/types/DomainTypes.ts
+++ b/frontend/src/types/DomainTypes.ts
@@ -1,5 +1,4 @@
-import { IDomain } from './ActionTypes';
-import { IUser } from './UserTypes';
+import { IUser, IUserDisplay } from './UserTypes';
export interface IDomainInfo {
id: number;
@@ -32,4 +31,8 @@ export interface IDomainDisplay {
user: string;
password?: string;
domainActive: boolean;
+}
+
+export interface IDomainOwnerDisplay extends IDomainDisplay {
+ owner: IUserDisplay
}
\ No newline at end of file
diff --git a/frontend/src/types/UserTypes.ts b/frontend/src/types/UserTypes.ts
index 54250b2..41ade9b 100644
--- a/frontend/src/types/UserTypes.ts
+++ b/frontend/src/types/UserTypes.ts
@@ -1,8 +1,24 @@
export interface IUser {
+ id: number;
first_name: string;
last_name: string;
email: string;
is_active: boolean,
is_superuser: boolean,
- roles: string[]
+ roles: object[]
}
+
+export interface IUserDisplay {
+ id: number;
+ firstName: string;
+ lastName: string;
+ fullName: string;
+ fullNameSearch: string;
+ email: string;
+ isActive: boolean,
+ isSuperuser: boolean,
+}
+
+export interface IUserRolesDisplay extends IUserDisplay {
+ roles: object[]
+}
\ No newline at end of file