|
@@ -57,19 +57,19 @@ export const RegionProvider = ({ children }: { children: React.ReactNode }) => {
|
|
|
|
|
|
const currentYear = new Date().getFullYear();
|
|
|
const currentMonth = new Date().getMonth() + 1;
|
|
|
- updatedNM.first_visit_year = currentYear;
|
|
|
- updatedNM.last_visit_year = currentYear;
|
|
|
+ updatedNM.first_visit_year = undefined;
|
|
|
+ updatedNM.last_visit_year = undefined;
|
|
|
updatedNM.best_visit_quality = 3;
|
|
|
|
|
|
const updatedNMData = {
|
|
|
token,
|
|
|
region,
|
|
|
quality: 3,
|
|
|
- year_from: currentYear,
|
|
|
- month_from: currentMonth,
|
|
|
+ year_from: undefined,
|
|
|
+ month_from: undefined,
|
|
|
day_from: undefined,
|
|
|
- year_to: currentYear,
|
|
|
- month_to: currentMonth,
|
|
|
+ year_to: undefined,
|
|
|
+ month_to: undefined,
|
|
|
day_to: undefined,
|
|
|
hidden: 0
|
|
|
};
|
|
@@ -168,8 +168,8 @@ export const RegionProvider = ({ children }: { children: React.ReactNode }) => {
|
|
|
if (item.id === id) {
|
|
|
return {
|
|
|
...item,
|
|
|
- year: visits === 0 ? first : currentYear,
|
|
|
- last: visits === 0 ? last : currentYear,
|
|
|
+ year: visits === 0 ? first : undefined,
|
|
|
+ last: visits === 0 ? last : undefined,
|
|
|
quality: visits === 0 ? quality : 3,
|
|
|
visits
|
|
|
};
|
|
@@ -197,11 +197,11 @@ export const RegionProvider = ({ children }: { children: React.ReactNode }) => {
|
|
|
token,
|
|
|
region: id,
|
|
|
quality: 3,
|
|
|
- year_from: currentYear,
|
|
|
- month_from: currentMonth,
|
|
|
+ year_from: undefined,
|
|
|
+ month_from: undefined,
|
|
|
day_from: undefined,
|
|
|
- year_to: currentYear,
|
|
|
- month_to: currentMonth,
|
|
|
+ year_to: undefined,
|
|
|
+ month_to: undefined,
|
|
|
day_to: undefined,
|
|
|
hidden: 0
|
|
|
};
|