Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBC22-2802: Added time and targets for route notifications settings. #811

Merged
merged 10 commits into from
Jan 29, 2025
14 changes: 9 additions & 5 deletions src/backend/apps/authentication/serializers.py
Original file line number Diff line number Diff line change
@@ -11,13 +11,17 @@ class Meta:


class SavedRoutesSerializer(SafeStringMixin, serializers.ModelSerializer):

class Meta:
model = SavedRoutes
fields = ('id', 'label', 'distance', 'distance_unit',
'start', 'start_point', 'end', 'end_point',
'validated', 'thumbnail', 'route', 'criteria',
'searchTimestamp', 'notification')
fields = (
'id', 'label', 'distance', 'distance_unit',
'start', 'start_point', 'end', 'end_point',
'validated', 'thumbnail', 'route', 'criteria',
'searchTimestamp', 'notification', 'notification_types',
'notification_days', 'notification_start_date',
'notification_end_date', 'notification_start_time',
'notification_end_time',
)

def save(self):
''' Save the route with the requesting user. '''
280 changes: 280 additions & 0 deletions src/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/frontend/package.json
Original file line number Diff line number Diff line change
@@ -18,6 +18,8 @@
"@testing-library/user-event": "^13.5.0",
"@turf/turf": "^6.5.0",
"@uidotdev/usehooks": "^2.0.1",
"@vaadin/date-picker": "^24.6.2",
"@vaadin/time-picker": "^24.6.2",
"bootstrap": "^5.3.0",
"env-cmd": "^10.1.0",
"flatbush": "^4.4.0",
2 changes: 1 addition & 1 deletion src/frontend/src/Components/data/routes.js
Original file line number Diff line number Diff line change
@@ -161,7 +161,7 @@ export const patchRoute = async (route, selectedRoute, dispatch, body) => {
}

const savedRoute = await response.json();
const payload = {...route, notification: savedRoute.notification};
const payload = {...route, ...savedRoute};
if (selectedRoute && selectedRoute.id === route.id) {
dispatch(updateSelectedRoute(payload));
}
Loading