diff --git a/src/components/Config/ConfigChanger.tsx b/src/components/Config/ConfigChanger.tsx index 7d5c43c33..c4c499154 100644 --- a/src/components/Config/ConfigChanger.tsx +++ b/src/components/Config/ConfigChanger.tsx @@ -16,9 +16,6 @@ export default function ConfigChanger() { const [isRefreshing, toggle] = useToggle(); const onConfigChange = (value: string) => { - // TODO: check what should happen here with @manuel-rw - // Wheter it should check for the current url and then load the new config only on index - // Or it should always load the selected config and open index or ? --> change url to page setCookie('config-name', value ?? 'default', { maxAge: 60 * 60 * 24 * 30, sameSite: 'strict', diff --git a/src/pages/api/configs/[slug].ts b/src/pages/api/configs/[slug].ts index 9dc1a8dc8..2f628d00e 100644 --- a/src/pages/api/configs/[slug].ts +++ b/src/pages/api/configs/[slug].ts @@ -130,6 +130,7 @@ function Delete(req: NextApiRequest, res: NextApiResponse) { // Get the slug of the request const { slug } = req.query as { slug: string }; if (!slug) { + Consola.error('Rejected config deletion request because config slug was not present'); return res.status(400).json({ message: 'Wrong request', }); @@ -145,6 +146,7 @@ function Delete(req: NextApiRequest, res: NextApiResponse) { // If the target is not in the list of files, return an error if (!configs.includes(slug)) { + Consola.error(`Rejected config deletion request because config name '${slug}' was not included in present configurations`); return res.status(404).json({ message: 'Target not found', }); @@ -152,6 +154,7 @@ function Delete(req: NextApiRequest, res: NextApiResponse) { // Delete the file fs.unlinkSync(path.join('data/configs', `${slug}.json`)); + Consola.info(`Successfully deleted configuration '${slug}' from your file system`); return res.status(200).json({ message: 'Configuration deleted with success', });