fix [both]: adjust request params

This commit is contained in:
Alice 2022-07-19 02:43:02 +02:00
parent e493543ca5
commit 7265f31851
2 changed files with 2 additions and 2 deletions

View file

@ -29,7 +29,7 @@ const props = defineProps({
const filmsByMonth = ref<FilmsByMonth[]>() const filmsByMonth = ref<FilmsByMonth[]>()
filmsByMonth.value = ( filmsByMonth.value = (
await apiGet<FilmsByMonth[]>(`films/calendar/`, { await apiGet<FilmsByMonth[]>(`films/calendar/`, {
past: props.past, period: props.past ? "past" : "future",
}) })
).data.value ).data.value
</script> </script>

View file

@ -54,7 +54,7 @@ class FilmViewSet(mixins.RetrieveModelMixin, mixins.ListModelMixin, GenericViewS
def get_queryset(self): def get_queryset(self):
queryset = Film.objects.all().filter(is_confirmed=True) queryset = Film.objects.all().filter(is_confirmed=True)
past = self.request.query_params.get("past", False) past = self.request.query_params.get("period", "future") == "past"
date_filter = ( date_filter = (
Q(projection_date__date__lt=datetime.now()) Q(projection_date__date__lt=datetime.now())
if past if past