mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
[bug] fix "delete profile" always removing current language, not the selected one
This commit is contained in:
parent
823e4825a2
commit
50ff42f564
@ -40,7 +40,7 @@
|
|||||||
await this.$confirm(this.$t('profile.deleteConfirm'), 'danger');
|
await this.$confirm(this.$t('profile.deleteConfirm'), 'danger');
|
||||||
|
|
||||||
this.deleting = true;
|
this.deleting = true;
|
||||||
const response = await this.$axios.$post(`/profile/delete`);
|
const response = await this.$axios.$post(`/profile/delete/${locale}`);
|
||||||
this.deleting = false;
|
this.deleting = false;
|
||||||
this.$emit('update', response);
|
this.$emit('update', response);
|
||||||
},
|
},
|
||||||
|
@ -80,8 +80,8 @@ router.post('/profile/save', async (req, res) => {
|
|||||||
return res.json(await fetchProfiles(req.db, req.user.username, true));
|
return res.json(await fetchProfiles(req.db, req.user.username, true));
|
||||||
});
|
});
|
||||||
|
|
||||||
router.post('/profile/delete', async (req, res) => {
|
router.post('/profile/delete/:locale', async (req, res) => {
|
||||||
await req.db.get(SQL`DELETE FROM profiles WHERE userId = ${req.user.id} AND locale = ${req.config.locale}`);
|
await req.db.get(SQL`DELETE FROM profiles WHERE userId = ${req.user.id} AND locale = ${req.params.locale}`);
|
||||||
|
|
||||||
return res.json(await fetchProfiles(req.db, req.user.username, true));
|
return res.json(await fetchProfiles(req.db, req.user.username, true));
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user