diff --git a/api/funkwhale_api/common/schema.yml b/api/funkwhale_api/common/schema.yml index 07ce1033d..e8949ed83 100644 --- a/api/funkwhale_api/common/schema.yml +++ b/api/funkwhale_api/common/schema.yml @@ -7270,6 +7270,10 @@ paths: enum: - json - xspf + - in: query + name: index + schema: + type: integer - in: path name: uuid schema: @@ -7316,6 +7320,10 @@ paths: enum: - json - xspf + - in: query + name: index + schema: + type: integer - in: path name: uuid schema: @@ -16815,6 +16823,10 @@ paths: enum: - json - xspf + - in: query + name: index + schema: + type: integer - in: path name: uuid schema: @@ -16861,6 +16873,10 @@ paths: enum: - json - xspf + - in: query + name: index + schema: + type: integer - in: path name: uuid schema: diff --git a/api/funkwhale_api/playlists/views.py b/api/funkwhale_api/playlists/views.py index 95c4387f6..37a4fb89f 100644 --- a/api/funkwhale_api/playlists/views.py +++ b/api/funkwhale_api/playlists/views.py @@ -4,7 +4,7 @@ from itertools import chain from django.conf import settings from django.db import transaction from django.db.models import Count -from drf_spectacular.utils import extend_schema +from drf_spectacular.utils import OpenApiParameter, OpenApiTypes, extend_schema from rest_framework import exceptions, mixins, status, viewsets from rest_framework.decorators import action from rest_framework.pagination import PageNumberPagination @@ -205,7 +205,10 @@ class PlaylistViewSet( ), ) - @extend_schema(operation_id="remove_from_playlist") + @extend_schema( + operation_id="remove_from_playlist", + parameters=[OpenApiParameter("index", OpenApiTypes.INT, location="query")], + ) @action(methods=["post", "delete"], detail=True) @transaction.atomic def remove(self, request, *args, **kwargs): diff --git a/front/src/generated/types.ts b/front/src/generated/types.ts index db8297d60..4ed5ad148 100644 --- a/front/src/generated/types.ts +++ b/front/src/generated/types.ts @@ -14405,6 +14405,7 @@ export interface operations { parameters: { query?: { format?: "json" | "xspf"; + index?: number; }; header?: never; path: { @@ -14436,6 +14437,7 @@ export interface operations { parameters: { query?: { format?: "json" | "xspf"; + index?: number; }; header?: never; path: { @@ -21406,6 +21408,7 @@ export interface operations { parameters: { query?: { format?: "json" | "xspf"; + index?: number; }; header?: never; path: { @@ -21437,6 +21440,7 @@ export interface operations { parameters: { query?: { format?: "json" | "xspf"; + index?: number; }; header?: never; path: {