Skip to content

Commit

Permalink
Uses a generic form field name for payload upload
Browse files Browse the repository at this point in the history
This will facilitate a migration to a generic and API v2 compatible file
upload code in the file service.
  • Loading branch information
jbaptperez committed Jun 7, 2024
1 parent 23de850 commit 78c819d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/api/v2/handlers/payload_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async def get_payloads(self, request: web.Request):
async def post_payloads(self, request: web.Request):
# As aiohttp_apispec.form_schema already calls request.multipart(),
# accessing the file using the prefilled request["form"] dictionary.
field_field: web.FileField = request["form"]["payload"]
field_field: web.FileField = request["form"]["file"]

file_name, file_path = await self.__generate_file_name_and_path(field_field)

Expand Down
2 changes: 1 addition & 1 deletion app/api/v2/schemas/payload_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class PayloadSchema(schema.Schema):


class PayloadCreateRequestSchema(schema.Schema):
payload = fields.Raw(type="file", required=True)
file = fields.Raw(type="file", required=True)


class PayloadDeleteRequestSchema(schema.Schema):
Expand Down

0 comments on commit 78c819d

Please sign in to comment.