mirror of https://github.com/zulip/zulip.git
attachments: Correct attachment_id type from string to integer.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
82f105aada
commit
b1f6ff20ef
|
@ -5015,8 +5015,8 @@ paths:
|
||||||
description: |
|
description: |
|
||||||
The ID of the attachment to be deleted.
|
The ID of the attachment to be deleted.
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: integer
|
||||||
example: "1"
|
example: 1
|
||||||
required: true
|
required: true
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
|
|
|
@ -16,8 +16,8 @@ def list_by_user(request: HttpRequest, user_profile: UserProfile) -> HttpRespons
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def remove(request: HttpRequest, user_profile: UserProfile, attachment_id: str) -> HttpResponse:
|
def remove(request: HttpRequest, user_profile: UserProfile, attachment_id: int) -> HttpResponse:
|
||||||
attachment = access_attachment_by_id(user_profile, int(attachment_id), needs_owner=True)
|
attachment = access_attachment_by_id(user_profile, attachment_id, needs_owner=True)
|
||||||
remove_attachment(user_profile, attachment)
|
remove_attachment(user_profile, attachment)
|
||||||
notify_attachment_update(user_profile, "remove", {"id": int(attachment_id)})
|
notify_attachment_update(user_profile, "remove", {"id": attachment_id})
|
||||||
return json_success(request)
|
return json_success(request)
|
||||||
|
|
Loading…
Reference in New Issue