diff --git a/backend/src/routes/posts.route.ts b/backend/src/routes/posts.route.ts index 9f4cf776..93e39b1c 100644 --- a/backend/src/routes/posts.route.ts +++ b/backend/src/routes/posts.route.ts @@ -132,6 +132,9 @@ postsRouter.post("/delete", async (req, res) => { const id = req.body.requestId as string; const service = req.body.service as string; const status = req.body.status as string; + const source = req.body.source as string; + const destination = req.body.destination as string; + const costInPoints = parseInt(req.body.costInPoints) as number; const authorEmail = req.session.email as string; @@ -139,7 +142,10 @@ postsRouter.post("/delete", async (req, res) => { id, authorEmail, status, - service + service, + source, + destination, + costInPoints }); if (delPost.error) { diff --git a/frontend/app/post/details/[slug]/page.tsx b/frontend/app/post/details/[slug]/page.tsx index c84d04e9..63e0c71e 100644 --- a/frontend/app/post/details/[slug]/page.tsx +++ b/frontend/app/post/details/[slug]/page.tsx @@ -115,6 +115,10 @@ const PostDetailsPage = ({ params }: Props) => { const res = await axios.post(siteConfig.server_url + "/post/delete", { requestId: params.slug, service: data.service, + status: data.service, + source: data.source, + destination: data.destination, + costInPoints: data.costInPoints }, { withCredentials: true, headers: { @@ -126,8 +130,8 @@ const PostDetailsPage = ({ params }: Props) => { setError("") setMessage("Post deleted successfully.") setTimeout(function () { - window.location.href = "/"; - }, 1000); + window.location.href = "/"; + }, 1000); } else if (res.status == HttpCodes.UNAUTHORIZED) { window.location.href = ('/') }