浏览代码

tambah fungsi log admin

yazid138 3 年之前
父节点
当前提交
18e874240b
共有 1 个文件被更改,包括 15 次插入0 次删除
  1. 15 0
      actions/log.js

+ 15 - 0
actions/log.js

@@ -40,3 +40,18 @@ export const getLogPublic = async ({ no_hp, no_laporan }) => {
 		return false;
 	}
 };
+
+export const createLog = async (token, data) => {
+	const res = await axios.post("/log", data, { headers: { Authorization: token } });
+	return res.data;
+};
+
+export const getLogAdmin = async (token) => {
+	try {
+		const res = await axios.get(`/log`, { headers: { Authorization: token } });
+		return res.data;
+	} catch (error) {
+		console.log("error", error);
+		return false;
+	}
+};