diff --git a/js/docs/src/content/docs/lex-reference/openapi.json b/js/docs/src/content/docs/lex-reference/openapi.json index 2b990613..0384af33 100644 --- a/js/docs/src/content/docs/lex-reference/openapi.json +++ b/js/docs/src/content/docs/lex-reference/openapi.json @@ -89,7 +89,15 @@ "tags": ["place.stream.vod"], "responses": { "200": { - "description": "Success" + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": {} + } + } + } }, "400": { "description": "Bad Request", diff --git a/js/docs/src/content/docs/lex-reference/vod/place-stream-vod-deletedraft.md b/js/docs/src/content/docs/lex-reference/vod/place-stream-vod-deletedraft.md index 2aa64157..91c22ed7 100644 --- a/js/docs/src/content/docs/lex-reference/vod/place-stream-vod-deletedraft.md +++ b/js/docs/src/content/docs/lex-reference/vod/place-stream-vod-deletedraft.md @@ -28,6 +28,14 @@ Discard a draft VOD. The processed content blob is not deleted (it may be refere | ----- | -------- | ----- | --------------------------------------- | ----------- | | `uri` | `string` | ✅ | The ats:// URI of the draft to discard. | | +**Output:** + +- **Encoding:** `application/json` +- **Schema:** + +**Schema Type:** `object` + +_(No properties defined)_ **Possible Errors:** - `NotFound`: No draft exists with the given URI for the authenticated user. @@ -57,6 +65,13 @@ Discard a draft VOD. The processed content blob is not deleted (it may be refere } } }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": {} + } + }, "errors": [ { "name": "NotFound", diff --git a/lexicons/place/stream/vod/deleteDraft.json b/lexicons/place/stream/vod/deleteDraft.json index 51c38da4..a88e2b0e 100644 --- a/lexicons/place/stream/vod/deleteDraft.json +++ b/lexicons/place/stream/vod/deleteDraft.json @@ -18,6 +18,13 @@ } } }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": {} + } + }, "errors": [ { "name": "NotFound", diff --git a/pkg/spxrpc/place_stream_vod_drafts.go b/pkg/spxrpc/place_stream_vod_drafts.go index 0b7e5258..2d55b725 100644 --- a/pkg/spxrpc/place_stream_vod_drafts.go +++ b/pkg/spxrpc/place_stream_vod_drafts.go @@ -139,26 +139,26 @@ func (s *Server) handlePlaceStreamVodUpdateDraft(ctx context.Context, body *plac return &placestream.VodUpdateDraft_Output{Draft: view}, nil } -func (s *Server) handlePlaceStreamVodDeleteDraft(ctx context.Context, body *placestream.VodDeleteDraft_Input) error { +func (s *Server) handlePlaceStreamVodDeleteDraft(ctx context.Context, body *placestream.VodDeleteDraft_Input) (*placestream.VodDeleteDraft_Output, error) { session, _ := oatproxy.GetOAuthSession(ctx) if session == nil { - return echo.NewHTTPError(http.StatusUnauthorized, "oauth session required") + return nil, echo.NewHTTPError(http.StatusUnauthorized, "oauth session required") } if body.Uri == "" { - return echo.NewHTTPError(http.StatusBadRequest, "uri is required") + return nil, echo.NewHTTPError(http.StatusBadRequest, "uri is required") } // Verify ownership before deleting. if _, err := s.loadOwnedDraft(ctx, body.Uri, session.DID); err != nil { - return err + return nil, err } deleted, err := s.statefulDB.DeleteDraft(ctx, body.Uri) if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, err.Error()) + return nil, echo.NewHTTPError(http.StatusInternalServerError, err.Error()) } if !deleted { - return draftNotFound() + return nil, draftNotFound() } - return nil + return &placestream.VodDeleteDraft_Output{}, nil } func (s *Server) handlePlaceStreamVodPublishDraft(ctx context.Context, body *placestream.VodPublishDraft_Input) (*placestream.VodPublishDraft_Output, error) { diff --git a/pkg/spxrpc/stubs.go b/pkg/spxrpc/stubs.go index b6e08a69..80f0fcf7 100644 --- a/pkg/spxrpc/stubs.go +++ b/pkg/spxrpc/stubs.go @@ -1364,13 +1364,14 @@ func (s *Server) HandlePlaceStreamVodDeleteDraft(c echo.Context) error { if err := c.Bind(&body); err != nil { return err } + var out *placestream.VodDeleteDraft_Output var handleErr error - // func (s *Server) handlePlaceStreamVodDeleteDraft(ctx context.Context,body *placestream.VodDeleteDraft_Input) error - handleErr = s.handlePlaceStreamVodDeleteDraft(ctx, &body) + // func (s *Server) handlePlaceStreamVodDeleteDraft(ctx context.Context,body *placestream.VodDeleteDraft_Input) (*placestream.VodDeleteDraft_Output, error) + out, handleErr = s.handlePlaceStreamVodDeleteDraft(ctx, &body) if handleErr != nil { return handleErr } - return nil + return c.JSON(200, out) } func (s *Server) HandlePlaceStreamVodGetComments(c echo.Context) error { diff --git a/pkg/streamplace/voddeleteDraft.go b/pkg/streamplace/voddeleteDraft.go index c70b092d..9ce62dec 100644 --- a/pkg/streamplace/voddeleteDraft.go +++ b/pkg/streamplace/voddeleteDraft.go @@ -16,11 +16,16 @@ type VodDeleteDraft_Input struct { Uri string `json:"uri" cborgen:"uri"` } +// VodDeleteDraft_Output is the output of a place.stream.vod.deleteDraft call. +type VodDeleteDraft_Output struct { +} + // VodDeleteDraft calls the XRPC method "place.stream.vod.deleteDraft". -func VodDeleteDraft(ctx context.Context, c lexutil.LexClient, input *VodDeleteDraft_Input) error { - if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "place.stream.vod.deleteDraft", nil, input, nil); err != nil { - return err +func VodDeleteDraft(ctx context.Context, c lexutil.LexClient, input *VodDeleteDraft_Input) (*VodDeleteDraft_Output, error) { + var out VodDeleteDraft_Output + if err := c.LexDo(ctx, lexutil.Procedure, "application/json", "place.stream.vod.deleteDraft", nil, input, &out); err != nil { + return nil, err } - return nil + return &out, nil }