fix: Hot bug fix

This commit is contained in:
2025-06-15 20:38:48 +03:00
parent 481385c2f4
commit 32a7cb44d1
24 changed files with 900 additions and 250 deletions

View File

@@ -91,14 +91,16 @@ class CountryStore {
return response.data;
};
deleteCountry = async (code: string, language: keyof CashedCountries) => {
deleteCountry = async (code: string) => {
await authInstance.delete(`/country/${code}`);
runInAction(() => {
this.countries[language].data = this.countries[language].data.filter(
(country) => country.code !== code
);
this.countries[language].loaded = true;
for (const lang of ["ru", "en", "zh"]) {
this.countries[lang as keyof CashedCountries].data = this.countries[
lang as keyof CashedCountries
].data.filter((country) => country.code !== code);
}
this.country[code] = {
ru: null,
en: null,