diff --git a/components/Navbar.vue b/components/Navbar.vue index 0908274..14ba567 100644 --- a/components/Navbar.vue +++ b/components/Navbar.vue @@ -54,6 +54,12 @@ to="/satu_rssa/logapi" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + C A R I + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/api/satu_rssa/logapiByMethod/index.post.ts b/server/api/satu_rssa/logapiByMethod/index.post.ts new file mode 100644 index 0000000..9fc2c05 --- /dev/null +++ b/server/api/satu_rssa/logapiByMethod/index.post.ts @@ -0,0 +1,15 @@ +import axios from "axios" + +export default defineEventHandler(async (event) => { + const body = await readBody(event) + try { + const response = await axios.post("http://10.10.123.140:8082/api/suratkontrol/datalogmethod",body) + return response.data + // console.log("ini data response",response.data) + } catch (error) { + throw createError({ + statusCode: 500, + statusMessage: "Failed to fetch data log api by method", + }) + } +}) \ No newline at end of file diff --git a/stores/users.ts b/stores/users.ts index 6b27e3e..c42716a 100644 --- a/stores/users.ts +++ b/stores/users.ts @@ -151,6 +151,29 @@ export const useDataLogAPIGet = defineStore("DataLogAPI", () => { } }); +export const useDataLogAPIByMethod = defineStore("DataLogAPIByMethod", () => { + const dataLogAPIByMethod = ref([]); + const loadDataLogAPI = async (reqDataLogAPI: Record) => { + try { + console.log("REQ", reqDataLogAPI) + dataLogAPIByMethod.value = await $fetch("/api/satu_rssa/logapiByMethod", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(reqDataLogAPI) + }); + console.log(dataLogAPIByMethod.value) + } catch (error) { + console.error("Failed to load data log api:", error); + } + }; + return{ + dataLogAPIByMethod, + loadDataLogAPI, + } +}); + export const useDataKunjunganPasien = defineStore("DataKunjunganPasien", () => { const dataKunjunganPasien = ref([]);