mirror of
https://codeberg.org/pluja/kycnot.me
synced 2025-02-11 12:58:29 -05:00
optimize api response
This commit is contained in:
parent
3e5090ccb6
commit
4da4416cd9
@ -4,11 +4,11 @@ type Service struct {
|
||||
Category string `json:"category"`
|
||||
CollectionID string `json:"collectionId"`
|
||||
CollectionName string `json:"collectionName"`
|
||||
Comments []string `json:"comments"`
|
||||
Comments []string `json:"comments,omitempty"`
|
||||
Created string `json:"created"`
|
||||
Description string `json:"description"`
|
||||
Expand map[string][]Attribute `json:"expand"`
|
||||
Attributes []string `json:"attributes"`
|
||||
Expand map[string][]Attribute `json:"expand,omitempty"`
|
||||
Attributes []string `json:"attributes,omitempty"`
|
||||
ID string `json:"id"`
|
||||
KycLevel int `json:"kyc_level"`
|
||||
Listed bool `json:"listed"`
|
||||
@ -18,7 +18,7 @@ type Service struct {
|
||||
Pending bool `json:"pending"`
|
||||
Score int `json:"score"`
|
||||
Tags []string `json:"tags"`
|
||||
TosReviews []TosReview `json:"tos_reviews"`
|
||||
TosReviews []TosReview `json:"tos_reviews,omitempty"`
|
||||
LastTosReview string `json:"last_tos_review"`
|
||||
TosUrls []string `json:"tos_urls"`
|
||||
Type string `json:"type"`
|
||||
@ -31,7 +31,7 @@ type Service struct {
|
||||
Fiat bool `json:"fiat"`
|
||||
Cash bool `json:"cash"`
|
||||
Lightning bool `json:"lightning"`
|
||||
Notes []string `json:"notes"`
|
||||
Notes []string `json:"notes,omitempty"`
|
||||
}
|
||||
|
||||
type TosReview struct {
|
||||
|
@ -18,6 +18,15 @@ func (s *Server) handleApiService(c iris.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// Remove 'tosReviews' service field to make a shorter answer
|
||||
service.TosReviews = nil
|
||||
service.Notes = nil
|
||||
service.Comments = nil
|
||||
service.Expand = nil
|
||||
service.Attributes = nil
|
||||
|
||||
// Ensure to remove any other additional unnecessary fields to ensure code efficiency and better clarity.
|
||||
|
||||
// Return the service as JSON
|
||||
c.JSON(service)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user