tsk-58: Update names of Contact endpoint (#67)

Closes #58

Reviewed-on: phoenix/textsender-api#67
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
phoenix
2026-01-07 20:24:30 +00:00
committed by phoenix
parent 4e250d095c
commit a51979e724
11 changed files with 460 additions and 8 deletions
+60
View File
@@ -163,6 +163,12 @@ definitions:
type: object
handler.RequestAddContact:
properties:
first_name:
type: string
last_name:
type: string
nickname:
type: string
phone_number:
type: string
user_id:
@@ -236,6 +242,28 @@ definitions:
message:
type: string
type: object
handler.UpdateNameRequest:
properties:
contact_id:
type: string
first_name:
type: string
last_name:
type: string
nickname:
type: string
user_id:
type: string
type: object
handler.UpdateNameResponse:
properties:
data:
items:
$ref: '#/definitions/contact.Contact'
type: array
message:
type: string
type: object
message.Message:
properties:
content:
@@ -348,6 +376,38 @@ paths:
summary: Add contact
tags:
- contacts
/contact/update:
patch:
consumes:
- application/json
description: Update the first, last, or nickname of a Contact (requires JWT)
parameters:
- description: Data to update contact's names
in: body
name: request
required: true
schema:
$ref: '#/definitions/handler.UpdateNameRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.UpdateNameResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handler.UpdateNameResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handler.UpdateNameResponse'
security:
- BearerAuth: []
summary: Update names of Contact
tags:
- contacts
/instant/message:
post:
consumes: