ปรับ API เครื่องราชฯ
This commit is contained in:
parent
e0252fedfc
commit
18d995ff30
3 changed files with 17 additions and 10 deletions
|
|
@ -42,7 +42,7 @@ export default {
|
|||
insigniaOrg,
|
||||
insigniaTypeOrg,
|
||||
insigniaTypeNewOrg: `${insigniaOrg}`,
|
||||
insigniaTypeNewIdOrg: (id: string) => `${insigniaOrg}${id}`,
|
||||
insigniaTypeNewIdOrg: (id: string) => `${insigniaTypeOrg}${id}`,
|
||||
insigniaNewIdOrg: (id: string) => `${insigniaOrg}${id}`,
|
||||
insigniaSortOrg: (id: string) => `${insigniaOrg}sort/${id}`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -206,14 +206,20 @@ async function onSubmit() {
|
|||
}
|
||||
|
||||
async function addData() {
|
||||
await http.post(config.API.insigniaOrg, {
|
||||
name: name.value,
|
||||
isActive: isActive.value,
|
||||
shortName: shortName.value,
|
||||
note: note.value == "" ? "-" : note.value,
|
||||
insigniaTypeId: id.value,
|
||||
});
|
||||
fetchData(id.value);
|
||||
await http
|
||||
.post(config.API.insigniaOrg, {
|
||||
name: name.value,
|
||||
isActive: isActive.value,
|
||||
shortName: shortName.value,
|
||||
note: note.value == "" ? "-" : note.value,
|
||||
insigniaTypeId: id.value,
|
||||
})
|
||||
.then(() => {
|
||||
fetchData(id.value);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
|
||||
async function editData(idData: string) {
|
||||
|
|
@ -256,6 +262,7 @@ const dialogOrder = ref<boolean>(false);
|
|||
<q-tooltip> เพิ่มข้อมูล </q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="store.row.length > 0"
|
||||
flat
|
||||
round
|
||||
color="blue-6"
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ const visibleColumns = ref<string[]>([
|
|||
async function fetchData() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.insigniaTypeNewOrg)
|
||||
.get(config.API.insigniaTypeOrg)
|
||||
.then(async (res) => {
|
||||
store.fetchData(res.data.result);
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue