24 lines
552 B
TypeScript
24 lines
552 B
TypeScript
import axios from "axios";
|
|
export default defineEventHandler(async (event) => {
|
|
const body = await readBody(event)
|
|
console.log(body)
|
|
try {
|
|
console.log("MASUK DALAM SINI")
|
|
const response = await axios.post("http://10.10.150.129:8082/api/kunjunganpasien/listkunjunganpasien", body);
|
|
console.log(response.data)
|
|
|
|
|
|
|
|
return response.data
|
|
} catch (error) {
|
|
console.error("Error posting to API:", error);
|
|
|
|
throw createError({
|
|
statusCode: 500,
|
|
statusMessage: "Failed to fetch data from API",
|
|
});
|
|
}
|
|
});
|
|
|
|
|