fix api call result

This commit is contained in:
xue jiahao
2024-11-27 11:19:15 +08:00
parent 0232e0d2c2
commit c5048a2ac3
5 changed files with 20 additions and 28 deletions

View File

@@ -181,8 +181,8 @@ let ownerid = ref('');
const getDomain = async () => {
loading.value = true;
const userId = authStore.userId;
const result = await api.get<IDomain[]>(`api/domain?userId=${userId}`);
rows.value = result.data.map((item) => {
const result = await api.get<IDomain[]>(`api/domains`);
rows.value = result.data.data.map((item) => {
return {
id: item.id,
tenantid: item.tenantid,
@@ -216,8 +216,7 @@ const deleteDomain = () => {
api.delete(`api/domain/${editId.value}`).then(() => {
getDomain();
})
editId.value = 0;
editId.value = 0; // set in removeRow()
};
const editRow = (row) => {
@@ -259,6 +258,7 @@ const onSubmit = () => {
'is_active': domainActive.value,
'ownerid': authStore.userId || ''
}
// for search: api.put(`api/domain`)、api.post(`api/domain`)
api[method].apply(api, [`api/domain`, param]).then(() => {
getDomain();
domainStore.loadUserDomains();