You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
387 B
TypeScript
23 lines
387 B
TypeScript
export const submitNote = async (
|
|
note: Note,
|
|
query: NoteQuery
|
|
): Promise<ApiResponse> => {
|
|
let response: ApiResponse = {
|
|
status: 200,
|
|
message: 'Update',
|
|
error: null,
|
|
}
|
|
|
|
await useFetch('/api/note', {
|
|
method: 'POST',
|
|
query,
|
|
body: note,
|
|
onResponse({ response }) {
|
|
console.log('POST:', response._data.message)
|
|
response = response._data
|
|
},
|
|
})
|
|
|
|
return response
|
|
}
|