I tried to create a new record for "Test_Collection" collection in directus with this function in ApiService.ts file
public static test() {
ApiService.vueInstance.axios
.post("/items/Test_Collection", { name: "test", result: "123" }, {
headers: { "Content-type": "application/json;" },
})
.catch((error) => {
throw new Error(`[KT] ApiService ${error}`);
});
}
handleTestInsert3() {
ApiService.vueInstance.axios.post("/items/Test_Collection", { name: "test", result: "123" }, { headers: { "Content-Type": "application/json" } }
).catch((error) => {
throw new Error(`[KT] ApiService ${error}`);
});
}
Hi,
Sorry for the late reply.
Currently, we haven't tried integrating Metronic with the Directus API, but we will explore this possibility if there is sufficient demand.
Please ensure that your backend correctly retrieves the request data. To verify that your API is functioning properly, you can test the request using Postman.
Additionally, let us know if you encounter any client errors when making this request.
Regards,
Lauris Stepanovs,
Keenthemes Support Team