aboutsummaryrefslogtreecommitdiffstats
path: root/modules/structs
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2023-06-30 01:22:55 +0200
committerGitHub <noreply@github.com>2023-06-29 23:22:55 +0000
commit254a82842addb1475611789107c3720e37394879 (patch)
tree450449ee8e90da3bb1246918a424d211aa0a0115 /modules/structs
parent9fd63aaad1354cddd906a4b186b9f13dbbb83b86 (diff)
downloadgitea-254a82842addb1475611789107c3720e37394879.tar.gz
gitea-254a82842addb1475611789107c3720e37394879.zip
Add API for changing Avatars (#25369)
This adds an API for uploading and Deleting Avatars for of Users, Repos and Organisations. I'm not sure, if this should also be added to the Admin API. Resolves #25344 --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'modules/structs')
-rw-r--r--modules/structs/repo.go6
-rw-r--r--modules/structs/user.go6
2 files changed, 12 insertions, 0 deletions
diff --git a/modules/structs/repo.go b/modules/structs/repo.go
index 3b43f74c79..94992de72e 100644
--- a/modules/structs/repo.go
+++ b/modules/structs/repo.go
@@ -380,3 +380,9 @@ type NewIssuePinsAllowed struct {
Issues bool `json:"issues"`
PullRequests bool `json:"pull_requests"`
}
+
+// UpdateRepoAvatarUserOption options when updating the repo avatar
+type UpdateRepoAvatarOption struct {
+ // image must be base64 encoded
+ Image string `json:"image" binding:"Required"`
+}
diff --git a/modules/structs/user.go b/modules/structs/user.go
index f68b92ac06..0df67894b0 100644
--- a/modules/structs/user.go
+++ b/modules/structs/user.go
@@ -102,3 +102,9 @@ type RenameUserOption struct {
// unique: true
NewName string `json:"new_username" binding:"Required"`
}
+
+// UpdateUserAvatarUserOption options when updating the user avatar
+type UpdateUserAvatarOption struct {
+ // image must be base64 encoded
+ Image string `json:"image" binding:"Required"`
+}