Browse Source

tambah fungsi log admin

yazid138 3 năm trước cách đây
mục cha
commit
18e874240b
1 tập tin đã thay đổi với 15 bổ sung0 xóa
  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;
+	}
+};