dynamic folder route 404
Answered
West African Lion posted this in #help-forum
West African LionOP
const handleUpdate = async (nextTransaction: ITransaction) => {
try {
await fetch(`http://localhost:3000/api/transaction/${id}/update`, {
...
}My directory structure is this:
/api/transaction/[id]/update.ts
Answered by West African Lion
just api routes. Figured it out. Had to just restart the server for it to register... 🤷â€â™‚ï¸
2 Replies
@West African Lion
const handleUpdate = async (nextTransaction: ITransaction) => {
try {
await fetch(`http://localhost:3000/api/transaction/${id}/update`, {
...
}
My directory structure is this:
/api/transaction/[id]/update.ts
you should create the route in a
route.ts file if you are using app router/api/transaction/[id]/update/route.tsWest African LionOP
just api routes. Figured it out. Had to just restart the server for it to register... 🤷â€â™‚ï¸
Answer