Files
FE_CPONE/test/vuex/cpone-md-summary-fisik/api/fisikdetail.js
2026-04-27 10:13:31 +07:00

99 lines
2.4 KiB
JavaScript

const URL = "/one-api/mockup/masterdata/";
export async function searchdetail(prm) {
try {
var resp = await axios.post(URL + 'summaryfisik/searchdetail', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchtemplatecode(token, prm) {
try {
var resp = await axios.post(URL + 'summaryfisik/searchtemplatecode', {
token: token,
search: prm
});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function addnewdetail(prm) {
try {
var resp = await axios.post(URL + 'summaryfisik/addnewdetail', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function updatedetail(prm) {
try {
var resp = await axios.post(URL + 'summaryfisik/updatedetail', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function deletedetail(token,id) {
try {
var resp = await axios.post(URL + 'summaryfisik/deletedetail', { id: id, token:token });
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}