Hi, this is the function in my backend. It is being called perfectly. I need to redirect the user when the task is done. In the function, I have mentioned a comment line saying when I need to redirect the user. The link to redirect is also mentioned in line #7 with location:.
Should I try to implement router logic?
import { ok, notFound, serverError, badRequest } from 'wix-http-functions';
import wixData from 'wix-data';
export function post_myResponse(request) {
const response = {
"status" : 301,
"headers": {
"Content-Type": "application/json",
"Location" : "https://www. thecaninecompany. in/order-success"
}
};
const today = new Date();
let currentTimestamp = today.toLocaleDateString() + " " + today.toLocaleTimeString();
let toInsert = {
"response" : request.headers,
"timestamp" : currentTimestamp
};
wixData.insert("OrderResponse", toInsert);
//Redirect user now
return ok(response);
}