fix [both]: adjust request params
This commit is contained in:
parent
e493543ca5
commit
7265f31851
2 changed files with 2 additions and 2 deletions
|
@ -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>
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue