mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
setting profile image
This commit is contained in:
parent
367e863c91
commit
ba7d1b37a9
180
doc/api.oa3
180
doc/api.oa3
@ -43,12 +43,12 @@ paths:
|
|||||||
'200':
|
'200':
|
||||||
description: Awaiting announce
|
description: Awaiting announce
|
||||||
|
|
||||||
/admin/available:
|
/admin/status:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- admin
|
- admin
|
||||||
description: Check if portal params have been set
|
description: Check if portal params have been set
|
||||||
operationId: get-node-available
|
operationId: get-node-status
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: success
|
description: success
|
||||||
@ -58,13 +58,11 @@ paths:
|
|||||||
type: boolean
|
type: boolean
|
||||||
'500':
|
'500':
|
||||||
description: internal server error
|
description: internal server error
|
||||||
|
put:
|
||||||
/admin/claim:
|
|
||||||
post:
|
|
||||||
tags:
|
tags:
|
||||||
- admin
|
- admin
|
||||||
description: Set admin password and node domain
|
description: Set admin password and node domain
|
||||||
operationId: set-node-claim
|
operationId: set-node-status
|
||||||
security:
|
security:
|
||||||
- basicCredentials: []
|
- basicCredentials: []
|
||||||
parameters:
|
parameters:
|
||||||
@ -269,12 +267,12 @@ paths:
|
|||||||
type: string
|
type: string
|
||||||
format: binary
|
format: binary
|
||||||
|
|
||||||
/account/public/available:
|
/account/public/status:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- account
|
- account
|
||||||
description: Check if a public account can be created.
|
description: Check if a public account can be created.
|
||||||
operationId: get-public-available
|
operationId: get-public-status
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: success
|
description: success
|
||||||
@ -728,6 +726,10 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: success
|
description: success
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Profile'
|
||||||
'401':
|
'401':
|
||||||
description: permission denied
|
description: permission denied
|
||||||
'410':
|
'410':
|
||||||
@ -774,6 +776,10 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: success
|
description: success
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Profile'
|
||||||
'401':
|
'401':
|
||||||
description: permission denied
|
description: permission denied
|
||||||
'405':
|
'405':
|
||||||
@ -784,10 +790,9 @@ paths:
|
|||||||
description: internal server error
|
description: internal server error
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
application/octet-stream:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
format: binary
|
|
||||||
|
|
||||||
/profile/message:
|
/profile/message:
|
||||||
get:
|
get:
|
||||||
@ -983,7 +988,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Card'
|
$ref: '#/components/schemas/DataMessage'
|
||||||
'400':
|
'400':
|
||||||
description: invalid data message
|
description: invalid data message
|
||||||
'401':
|
'401':
|
||||||
@ -992,42 +997,8 @@ paths:
|
|||||||
description: account disabled
|
description: account disabled
|
||||||
'500':
|
'500':
|
||||||
description: internal server error
|
description: internal server error
|
||||||
requestBody:
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/DataMessage'
|
|
||||||
|
|
||||||
/contact/cards/{cardId}:
|
/contact/cards/{cardId}:
|
||||||
get:
|
|
||||||
tags:
|
|
||||||
- contact
|
|
||||||
description: get card entry. Access granted to app tokens of account holder.
|
|
||||||
operationId: get-card
|
|
||||||
security:
|
|
||||||
- bearerAuth: []
|
|
||||||
parameters:
|
|
||||||
- name: cardId
|
|
||||||
in: path
|
|
||||||
description: specified card id
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
responses:
|
|
||||||
'200':
|
|
||||||
description: success
|
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
$ref: '#/components/schemas/Card'
|
|
||||||
'401':
|
|
||||||
description: permission denied
|
|
||||||
'404':
|
|
||||||
description: card not found
|
|
||||||
'410':
|
|
||||||
description: account disabled
|
|
||||||
'500':
|
|
||||||
description: internal server error
|
|
||||||
delete:
|
delete:
|
||||||
tags:
|
tags:
|
||||||
- contact
|
- contact
|
||||||
@ -1075,6 +1046,30 @@ paths:
|
|||||||
required: false # required for connected
|
required: false # required for connected
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
|
- name: profileRevision
|
||||||
|
in: query
|
||||||
|
description: profile revision of contact
|
||||||
|
required: false # required for connected
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- name: articleRevision
|
||||||
|
in: query
|
||||||
|
description: article revision of contact
|
||||||
|
required: false # required for connected
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- name: channelRevision
|
||||||
|
in: query
|
||||||
|
description: channel revision of contact
|
||||||
|
required: false # required for connected
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- name: viewRevision
|
||||||
|
in: query
|
||||||
|
description: view revision of contact
|
||||||
|
required: false # required for connected
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: success
|
description: success
|
||||||
@ -1193,18 +1188,6 @@ paths:
|
|||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: successful operation
|
description: successful operation
|
||||||
content:
|
|
||||||
application/json:
|
|
||||||
schema:
|
|
||||||
type: object
|
|
||||||
required:
|
|
||||||
- status
|
|
||||||
properties:
|
|
||||||
token:
|
|
||||||
type: string
|
|
||||||
status:
|
|
||||||
type: string
|
|
||||||
enum: [ pending, confirmed, requested, connecting, connected ]
|
|
||||||
'400':
|
'400':
|
||||||
description: invalid data message
|
description: invalid data message
|
||||||
'410':
|
'410':
|
||||||
@ -1508,12 +1491,36 @@ paths:
|
|||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
|
|
||||||
/contact/content/revision:
|
/contact/article/revision:
|
||||||
put:
|
put:
|
||||||
tags:
|
tags:
|
||||||
- contact
|
- contact
|
||||||
description: Set content revision for contact. This is intend to be invoked automatically anytime a contact updates their content or sharing. Access granted to contact tokens.
|
description: Set artcile revision for contact. This is intend to be invoked automatically anytime a contact updates their content or sharing. Access granted to contact tokens.
|
||||||
operationId: set-content-revision
|
operationId: set-article-revision
|
||||||
|
security:
|
||||||
|
- bearerAuth: []
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: revision set
|
||||||
|
'401':
|
||||||
|
description: not authorized
|
||||||
|
'410':
|
||||||
|
description: account disabled
|
||||||
|
'500':
|
||||||
|
description: internal server error
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
|
||||||
|
/contact/channel/revision:
|
||||||
|
put:
|
||||||
|
tags:
|
||||||
|
- contact
|
||||||
|
description: Set channel revision for contact. This is intend to be invoked automatically anytime a contact updates their content or sharing. Access granted to contact tokens.
|
||||||
|
operationId: set-channel-revision
|
||||||
security:
|
security:
|
||||||
- bearerAuth: []
|
- bearerAuth: []
|
||||||
responses:
|
responses:
|
||||||
@ -1726,15 +1733,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: '#/components/schemas/Subject'
|
||||||
required:
|
|
||||||
- type
|
|
||||||
- data
|
|
||||||
properties:
|
|
||||||
type:
|
|
||||||
type: string
|
|
||||||
data:
|
|
||||||
type: string
|
|
||||||
|
|
||||||
/attribute/articles/{articleId}/groups/{groupId}:
|
/attribute/articles/{articleId}/groups/{groupId}:
|
||||||
put:
|
put:
|
||||||
@ -2375,15 +2374,7 @@ paths:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: '#/components/schemas/Subject'
|
||||||
required:
|
|
||||||
- type
|
|
||||||
- data
|
|
||||||
properties:
|
|
||||||
type:
|
|
||||||
type: string
|
|
||||||
data:
|
|
||||||
type: string
|
|
||||||
|
|
||||||
/content/channels/{channelId}/topics/{topicId}/assets:
|
/content/channels/{channelId}/topics/{topicId}/assets:
|
||||||
get:
|
get:
|
||||||
@ -2838,7 +2829,7 @@ components:
|
|||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- profile
|
- profile
|
||||||
- attribute
|
- article
|
||||||
- group
|
- group
|
||||||
- channel
|
- channel
|
||||||
- card
|
- card
|
||||||
@ -2989,7 +2980,7 @@ components:
|
|||||||
id:
|
id:
|
||||||
type: string
|
type: string
|
||||||
revision:
|
revision:
|
||||||
type: number
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
data:
|
data:
|
||||||
$ref: '#/components/schemas/CardData'
|
$ref: '#/components/schemas/CardData'
|
||||||
@ -3000,7 +2991,7 @@ components:
|
|||||||
- detailRevision
|
- detailRevision
|
||||||
- profileRevision
|
- profileRevision
|
||||||
- notifiedProfile
|
- notifiedProfile
|
||||||
- notifiedContent
|
- notifiedArticle
|
||||||
- notifiedChannel
|
- notifiedChannel
|
||||||
- notifiedView
|
- notifiedView
|
||||||
properties:
|
properties:
|
||||||
@ -3013,7 +3004,7 @@ components:
|
|||||||
notifiedProfile:
|
notifiedProfile:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
notifiedContent:
|
notifiedArticle:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
notifiedChannel:
|
notifiedChannel:
|
||||||
@ -3072,7 +3063,7 @@ components:
|
|||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
- revision
|
- revision
|
||||||
- ata
|
- data
|
||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
type: string
|
type: string
|
||||||
@ -3196,7 +3187,8 @@ components:
|
|||||||
id:
|
id:
|
||||||
type: string
|
type: string
|
||||||
revision:
|
revision:
|
||||||
type: string
|
type: integer
|
||||||
|
format: int64
|
||||||
data:
|
data:
|
||||||
$ref: '#/components/schemas/TopicData'
|
$ref: '#/components/schemas/TopicData'
|
||||||
|
|
||||||
@ -3266,7 +3258,8 @@ components:
|
|||||||
id:
|
id:
|
||||||
type: string
|
type: string
|
||||||
revision:
|
revision:
|
||||||
type: string
|
type: integer
|
||||||
|
format: int64
|
||||||
data:
|
data:
|
||||||
$ref: '#/components/schemas/TagData'
|
$ref: '#/components/schemas/TagData'
|
||||||
|
|
||||||
@ -3302,7 +3295,8 @@ components:
|
|||||||
id:
|
id:
|
||||||
type: string
|
type: string
|
||||||
revision:
|
revision:
|
||||||
type: string
|
type: integer
|
||||||
|
format: int64
|
||||||
data:
|
data:
|
||||||
$ref: '#/components/schemas/ArticleData'
|
$ref: '#/components/schemas/ArticleData'
|
||||||
|
|
||||||
@ -3412,7 +3406,7 @@ components:
|
|||||||
viewRevision:
|
viewRevision:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
contentRevision:
|
articleRevision:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
profileRevision:
|
profileRevision:
|
||||||
@ -3469,6 +3463,18 @@ components:
|
|||||||
properties:
|
properties:
|
||||||
token:
|
token:
|
||||||
type: string
|
type: string
|
||||||
|
profileRevision:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
articleRevision:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
channelRevision:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
viewRevision:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
status:
|
status:
|
||||||
type: string
|
type: string
|
||||||
enum: [ pending, confirmed, requested, connecting, connected ]
|
enum: [ pending, confirmed, requested, connecting, connected ]
|
||||||
|
@ -11,19 +11,7 @@ func GetProfile(w http.ResponseWriter, r *http.Request) {
|
|||||||
ErrResponse(w, code, err)
|
ErrResponse(w, code, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
detail := account.AccountDetail
|
|
||||||
|
|
||||||
profile := &Profile{
|
WriteResponse(w, getProfileModel(account))
|
||||||
Guid: account.Guid,
|
|
||||||
Handle: account.Username,
|
|
||||||
Description: detail.Description,
|
|
||||||
Location: detail.Location,
|
|
||||||
Image: detail.Image,
|
|
||||||
Revision: account.ProfileRevision,
|
|
||||||
Version: APP_VERSION,
|
|
||||||
Node: "https://" + getStrConfigValue(CONFIG_DOMAIN, "") + "/",
|
|
||||||
}
|
|
||||||
|
|
||||||
WriteResponse(w, profile)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,8 +18,4 @@ func GetProfileImage(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetProfileImage(w http.ResponseWriter, r *http.Request) {
|
|
||||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
|
||||||
w.WriteHeader(http.StatusOK)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@ func SetProfile(w http.ResponseWriter, r *http.Request) {
|
|||||||
ErrResponse(w, code, err)
|
ErrResponse(w, code, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
detail := account.AccountDetail
|
|
||||||
|
|
||||||
// extract profile data from body
|
// extract profile data from body
|
||||||
var profileData ProfileData;
|
var profileData ProfileData;
|
||||||
@ -24,12 +23,12 @@ func SetProfile(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// update record
|
// update record
|
||||||
detail.Name = profileData.Name
|
account.AccountDetail.Name = profileData.Name
|
||||||
detail.Location = profileData.Location
|
account.AccountDetail.Location = profileData.Location
|
||||||
detail.Description = profileData.Description
|
account.AccountDetail.Description = profileData.Description
|
||||||
|
|
||||||
err = store.DB.Transaction(func(tx *gorm.DB) error {
|
err = store.DB.Transaction(func(tx *gorm.DB) error {
|
||||||
if res := store.DB.Save(&detail).Error; res != nil {
|
if res := store.DB.Save(&account.AccountDetail).Error; res != nil {
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
if res := store.DB.Model(&account).Update("profile_revision", account.ProfileRevision + 1).Error; res != nil {
|
if res := store.DB.Model(&account).Update("profile_revision", account.ProfileRevision + 1).Error; res != nil {
|
||||||
@ -44,6 +43,6 @@ func SetProfile(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
SetProfileNotification(account)
|
SetProfileNotification(account)
|
||||||
SetStatus(account)
|
SetStatus(account)
|
||||||
WriteResponse(w, nil)
|
WriteResponse(w, getProfileModel(account))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
43
net/server/internal/api_setProfileImage.go
Normal file
43
net/server/internal/api_setProfileImage.go
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
package databag
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"databag/internal/store"
|
||||||
|
)
|
||||||
|
|
||||||
|
func SetProfileImage(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
account, code, err := BearerAppToken(r, true);
|
||||||
|
if err != nil {
|
||||||
|
ErrResponse(w, code, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var image string
|
||||||
|
if err := ParseRequest(r, w, &image); err != nil {
|
||||||
|
ErrResponse(w, http.StatusBadRequest, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
account.AccountDetail.Image = image
|
||||||
|
|
||||||
|
err = store.DB.Transaction(func(tx *gorm.DB) error {
|
||||||
|
if res := store.DB.Save(&account.AccountDetail).Error; res != nil {
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
if res := store.DB.Model(&account).Update("profile_revision", account.ProfileRevision + 1).Error; res != nil {
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
ErrResponse(w, http.StatusInternalServerError, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
SetProfileNotification(account)
|
||||||
|
SetStatus(account)
|
||||||
|
WriteResponse(w, getProfileModel(account))
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,20 @@ import (
|
|||||||
"databag/internal/store"
|
"databag/internal/store"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func getProfileModel(account *store.Account) *Profile {
|
||||||
|
|
||||||
|
return &Profile{
|
||||||
|
Guid: account.Guid,
|
||||||
|
Handle: account.Username,
|
||||||
|
Description: account.AccountDetail.Description,
|
||||||
|
Location: account.AccountDetail.Location,
|
||||||
|
Image: account.AccountDetail.Image,
|
||||||
|
Revision: account.ProfileRevision,
|
||||||
|
Version: APP_VERSION,
|
||||||
|
Node: "https://" + getStrConfigValue(CONFIG_DOMAIN, "") + "/",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func getCardModel(slot *store.CardSlot) *Card {
|
func getCardModel(slot *store.CardSlot) *Card {
|
||||||
|
|
||||||
if slot.Card == nil {
|
if slot.Card == nil {
|
||||||
|
@ -13,6 +13,7 @@ func TestUpdateProfile(t *testing.T) {
|
|||||||
var bCardRev int64
|
var bCardRev int64
|
||||||
var cProfileRev int64
|
var cProfileRev int64
|
||||||
var cCardRev int64
|
var cCardRev int64
|
||||||
|
var profile Profile
|
||||||
|
|
||||||
// setup testing group
|
// setup testing group
|
||||||
set, err := AddTestGroup("updateprofile")
|
set, err := AddTestGroup("updateprofile")
|
||||||
@ -44,7 +45,8 @@ func TestUpdateProfile(t *testing.T) {
|
|||||||
};
|
};
|
||||||
assert.NoError(t, SendEndpointTest(SetProfile, "PUT", "/profile/data",
|
assert.NoError(t, SendEndpointTest(SetProfile, "PUT", "/profile/data",
|
||||||
nil, profileData,
|
nil, profileData,
|
||||||
APP_TOKENAPP, set.A.Token, nil, nil))
|
APP_TOKENAPP, set.A.Token, &profile, nil))
|
||||||
|
assert.Equal(t, "databaggerr", profile.Description)
|
||||||
|
|
||||||
// recv websocket event
|
// recv websocket event
|
||||||
assert.NotEqual(t, bCardRev, GetTestRevision(set.B.Revisions).Card)
|
assert.NotEqual(t, bCardRev, GetTestRevision(set.B.Revisions).Card)
|
||||||
@ -88,9 +90,12 @@ func TestUpdateProfile(t *testing.T) {
|
|||||||
assert.Equal(t, card.Data.ProfileRevision, card.Data.NotifiedProfile)
|
assert.Equal(t, card.Data.ProfileRevision, card.Data.NotifiedProfile)
|
||||||
assert.Equal(t, card.Data.CardProfile.Name, "Namer")
|
assert.Equal(t, card.Data.CardProfile.Name, "Namer")
|
||||||
|
|
||||||
// TODO set image
|
// set profile image
|
||||||
// "iVBORw0KGgoAAAANSUhEUgAAAaQAAAGkCAIAAADxLsZiAAAFzElEQVR4nOzWUY3jMBhG0e0qSEqoaIqiaEIoGAxh3gZAldid3nMI+JOiXP3bGOMfwLf7v3oAwAxiBySIHZAgdkCC2AEJYgckiB2QIHZAgtgBCWIHJIgdkCB2QILYAQliBySIHZAgdkCC2AEJYgckiB2QIHZAgtgBCWIHJIgdkCB2QILYAQliBySIHZAgdkCC2AEJYgckiB2QIHZAgtgBCWIHJGzTXnrtx7S3pnk+7qsnnMk3+ny+0dtcdkCC2AEJYgckiB2QIHZAgtgBCWIHJIgdkCB2QILYAQliBySIHZAgdkCC2AEJYgckiB2QIHZAgtgBCWIHJIgdkCB2QILYAQliBySIHZAgdkCC2AEJYgckiB2QIHZAgtgBCWIHJIgdkCB2QILYAQliBySIHZAgdkCC2AEJYgckiB2QIHZAgtgBCWIHJIgdkCB2QILYAQliBySIHZAgdkCC2AEJYgckiB2QIHZAgtgBCWIHJIgdkCB2QILYAQliBySIHZAgdkCC2AEJYgckiB2QIHZAgtgBCWIHJIgdkCB2QILYAQnbtJeej/u0t+Bb+Y/e5rIDEsQOSBA7IEHsgASxAxLEDkgQ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EDEsQOSBA7IEHsgASxAxLEDkgQOyBB7IAEsQMSxA5IEDsgQeyABLEDEsQOSBA7IEHsgITbGGP1BoDLueyABLEDEsQOSBA7IEHsgASxAxLEDkgQOyBB7IAEsQMSxA5IEDsgQeyABLEDEsQOSBA7IEHsgASxAxLEDkgQOyBB7IAEsQMSxA5IEDsgQeyABLEDEsQOSBA7IEHsgASxAxLEDkgQOyBB7ICEnwAAAP//DQ4epwV6rzkAAAAASUVORK5CYII="
|
||||||
|
assert.NoError(t, SendEndpointTest(SetProfileImage, "PUT", "/profile/image",
|
||||||
|
nil, image,
|
||||||
|
APP_TOKENAPP, set.A.Token, &profile, nil))
|
||||||
|
|
||||||
// TODO retrieve image
|
// TODO retrieve and validate profile image
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user