Files
2026-05-25 20:01:37 +07:00

103 lines
2.1 KiB
JavaScript

const URL = "/one-api/mockup/masterdata/one-md-summary-fisik/";
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,
};
}
}