Skip to content

Commit

Permalink
fix delete redirection for posts
Browse files Browse the repository at this point in the history
  • Loading branch information
juandjara committed Nov 14, 2023
1 parent ebb5afc commit facdf67
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/routes/api/files.$project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,10 @@ export async function action({ params, request }: ActionArgs) {
if (redirectTarget === 'media' || refererPath === `/p/${project.id}/media`) {
return redirect(`/p/${project.id}/media`, { headers: { 'Set-Cookie': cookie }})
}
if (redirectTarget === 'post') {
const conf = await getProjectConfig(token, project)
const collection = conf.collections.find(c => folderFromCollection(c) === getDirname(path))
return redirect(`/p/${project.id}/${collection?.id}`, { headers: { 'Set-Cookie': cookie }})
}
}
}

0 comments on commit facdf67

Please sign in to comment.