slcing registrasi awal
This commit is contained in:
22
auth-code/api/api.js
Normal file
22
auth-code/api/api.js
Normal file
@@ -0,0 +1,22 @@
|
||||
const URL = "";
|
||||
|
||||
export async function callApi(fn_url, params, headers) {
|
||||
try {
|
||||
console.log("API CALL")
|
||||
var url = URL + fn_url
|
||||
var resp = await axios.post(url, params, headers)
|
||||
if (resp != 'OK') {
|
||||
return {
|
||||
status: 'ERR',
|
||||
message: resp.message
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user