Nouvelle interface
This commit is contained in:
17
src/services/Api.js
Normal file
17
src/services/Api.js
Normal file
@@ -0,0 +1,17 @@
|
||||
export default {
|
||||
async call(controller, method) {
|
||||
const apiUrl = '/App/api.php?prj=pharmamp&controller='+controller+'&method='+method
|
||||
|
||||
if (import.meta.env.DEV) {
|
||||
console.log(apiUrl)
|
||||
}
|
||||
|
||||
const response = await fetch(apiUrl)
|
||||
|
||||
if (import.meta.env.DEV) {
|
||||
console.log(response.clone().text())
|
||||
}
|
||||
|
||||
return response.json();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user