diff options
author | 2021-07-06 13:29:11 +0200 | |
---|---|---|
committer | 2021-07-06 13:29:11 +0200 | |
commit | 356857921897c0fb91add7f94e8944dd7e6c57b5 (patch) | |
tree | 2f6d8d42b6eba0ef3bc693c04be712bcef2af1d3 /internal/api/model | |
parent | Domain block (#76) (diff) | |
download | gotosocial-356857921897c0fb91add7f94e8944dd7e6c57b5.tar.xz |
Blocklist import (#77)
* first steps on importing blocklists
* unblock domains properly
Diffstat (limited to 'internal/api/model')
-rw-r--r-- | internal/api/model/domainblock.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/internal/api/model/domainblock.go b/internal/api/model/domainblock.go index aaa28f34d..66d155ad7 100644 --- a/internal/api/model/domainblock.go +++ b/internal/api/model/domainblock.go @@ -18,13 +18,15 @@ package model +import "mime/multipart" + // DomainBlock represents a block on one domain type DomainBlock struct { ID string `json:"id,omitempty"` - Domain string `json:"domain"` + Domain string `form:"domain" json:"domain" validation:"required"` Obfuscate bool `json:"obfuscate,omitempty"` PrivateComment string `json:"private_comment,omitempty"` - PublicComment string `json:"public_comment,omitempty"` + PublicComment string `form:"public_comment" json:"public_comment,omitempty"` SubscriptionID string `json:"subscription_id,omitempty"` CreatedBy string `json:"created_by,omitempty"` CreatedAt string `json:"created_at,omitempty"` @@ -32,8 +34,10 @@ type DomainBlock struct { // DomainBlockCreateRequest is the form submitted as a POST to /api/v1/admin/domain_blocks to create a new block. type DomainBlockCreateRequest struct { + // A list of domains to block. Only used if import=true is specified. + Domains *multipart.FileHeader `form:"domains" json:"domains" xml:"domains"` // hostname/domain to block - Domain string `form:"domain" json:"domain" xml:"domain" validation:"required"` + Domain string `form:"domain" json:"domain" xml:"domain"` // whether the domain should be obfuscated when being displayed publicly Obfuscate bool `form:"obfuscate" json:"obfuscate" xml:"obfuscate"` // private comment for other admins on why the domain was blocked |