penambahan tabel pencarian, form tambah, form ubah

This commit is contained in:
2024-11-08 13:36:24 +07:00
parent 23db6f226e
commit b475874694
16 changed files with 1870 additions and 633 deletions

View File

@@ -2,7 +2,7 @@ import axios from "axios";
export default defineEventHandler(async (event) => {
try {
const response = await axios.get("http://localhost:8082/api/suratkontrol");
const response = await axios.get("http://10.10.150.129:8082/api/suratkontrol");
// console.log(response.data)
return response.data
} catch (error) {

View File

@@ -3,15 +3,14 @@ import axios from "axios";
export default defineEventHandler(async (event) => {
// Read the body of the incoming request
const body = await readBody(event);
console.log(body)
console.log("masuk")
try {
const response = await axios.post("http://localhost:8082/api/suratkontrol/cari", body, {
headers: {
"Content-Type": "application/json",
},
});
console.log(response.data)
return response.data
// const response = await axios.post("http://10.10.150.129:8082/api/suratkontrol/cari", body, {
const response = await axios.post("http://10.10.150.129:8082/api/suratkontrol/insert/", body);
console.log(response)
// return response.data
} catch (error) {
console.error("Error posting to surat kontrol API:", error);

View File

@@ -0,0 +1,22 @@
import axios from "axios";
export default defineEventHandler(async (event) => {
// Read the body of the incoming request
const body = await readBody(event);
// console.log(body)
console.log("masuk")
try {
const response = await axios.post("http://10.10.150.129:8082/api/suratkontrol/cari", body)
// const response = await axios.post("http://10.10.150.129:8082/api/suratkontrol/insert/", body);
// console.log(response)
return response.data
} catch (error) {
console.error("Error posting to surat kontrol API:", error);
throw createError({
statusCode: 500,
statusMessage: "Failed to fetch data from surat kontrol API",
});
}
});