need help how can i redirect user
Unanswered
Cuvier’s Dwarf Caiman posted this in #help-forum
Cuvier’s Dwarf CaimanOP
i m trying like this
export async function initializeNewInventory() {
const { id } = await prisma.products.create({ data: {} })
redirect(
}
but not working...
export async function initializeNewInventory() {
const { id } = await prisma.products.create({ data: {} })
redirect(
/admin/inventory/${id})}
but not working...
1 Reply
Cuvier’s Dwarf CaimanOP
redirect function throw this error
failed to get redirect response TypeError: fetch failed
at Object.fetch (C:\Users\faiza\Documents\GitHub\gmae-ecommerce-cms-next-13\node_modules\next\dist\compiled\undici\index.js:1:26669) {
cause: RequestContentLengthMismatchError: Request body length does not match content-length header
at write (C:\Users\faiza\Documents\GitHub\gmae-ecommerce-cms-next-13\node_modules\next\dist\compiled\undici\index.js:1:67105)
at _resume (C:\Users\faiza\Documents\GitHub\gmae-ecommerce-cms-next-13\node_modules\next\dist\compiled\undici\index.js:1:66726)
at resume (C:\Users\faiza\Documents\GitHub\gmae-ecommerce-cms-next-13\node_modules\next\dist\compiled\undici\index.js:1:65413)
at connect (C:\Users\faiza\Documents\GitHub\gmae-ecommerce-cms-next-13\node_modules\next\dist\compiled\undici\index.js:1:65301) {
code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
}
}
failed to get redirect response TypeError: fetch failed
at Object.fetch (C:\Users\faiza\Documents\GitHub\gmae-ecommerce-cms-next-13\node_modules\next\dist\compiled\undici\index.js:1:26669) {
cause: RequestContentLengthMismatchError: Request body length does not match content-length header
at write (C:\Users\faiza\Documents\GitHub\gmae-ecommerce-cms-next-13\node_modules\next\dist\compiled\undici\index.js:1:67105)
at _resume (C:\Users\faiza\Documents\GitHub\gmae-ecommerce-cms-next-13\node_modules\next\dist\compiled\undici\index.js:1:66726)
at resume (C:\Users\faiza\Documents\GitHub\gmae-ecommerce-cms-next-13\node_modules\next\dist\compiled\undici\index.js:1:65413)
at connect (C:\Users\faiza\Documents\GitHub\gmae-ecommerce-cms-next-13\node_modules\next\dist\compiled\undici\index.js:1:65301) {
code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
}
}