Fisher
Fisher
NNuxt
Created by Fisher on 6/15/2024 in #❓・help
useFetch with patch method is making GET requests instead
Ha, issue was a misplaced parenthesis causing the request to send without any options I guess
const { data: application, refresh } = await useFetch<DeveloperApplicationDto>(`${config.public.abandonAuthUrl}/developer_application/${application_id}`, {
lazy: true,
headers: {
Authorization: `Bearer ${auth.value}`
}
})

async function submitNewCallbackUris() {
console.log()
if (application.value?.callback_uris !== undefined){
await useFetch<any>(`${config.public.abandonAuthUrl}/developer_application/${application_id}/callback_uris`, {
method: "patch",
headers: {
Authorization: `Bearer ${auth.value}`
},
body: application.value.callback_uris,
server: false
})
console.log("submitted new uris")
}
}
const { data: application, refresh } = await useFetch<DeveloperApplicationDto>(`${config.public.abandonAuthUrl}/developer_application/${application_id}`, {
lazy: true,
headers: {
Authorization: `Bearer ${auth.value}`
}
})

async function submitNewCallbackUris() {
console.log()
if (application.value?.callback_uris !== undefined){
await useFetch<any>(`${config.public.abandonAuthUrl}/developer_application/${application_id}/callback_uris`, {
method: "patch",
headers: {
Authorization: `Bearer ${auth.value}`
},
body: application.value.callback_uris,
server: false
})
console.log("submitted new uris")
}
}
2 replies