ENCOA-228 Now when user navigates between modules the generation items persist. Reading, listening and writing added to level module
This commit is contained in:
@@ -32,8 +32,13 @@ async function post(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
||||
const queryParams = queryToURLSearchParams(req);
|
||||
let endpoint = queryParams.getAll('module').join("/");
|
||||
|
||||
if (endpoint.startsWith("level")) {
|
||||
endpoint = "level/"
|
||||
} else if (endpoint.startsWith("listening")) {
|
||||
endpoint = "listening/"
|
||||
} else if (endpoint.startsWith("reading")) {
|
||||
endpoint = "reading/"
|
||||
}
|
||||
|
||||
const result = await axios.post(`${process.env.BACKEND_URL}/${endpoint}`,
|
||||
|
||||
Reference in New Issue
Block a user