fix: Hot bug fix
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user