refining some serialization
This commit is contained in:
@@ -109,5 +109,5 @@ func (m *appModule) appsPOSTHandler(c *gin.Context) {
|
||||
}
|
||||
|
||||
// done, return the new app information per the spec here: https://docs.joinmastodon.org/methods/apps/
|
||||
c.JSON(http.StatusOK, app.ToMasto())
|
||||
c.JSON(http.StatusOK, app.ToMastoSensitive())
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ type Application struct {
|
||||
VapidKey string
|
||||
}
|
||||
|
||||
// ToMasto returns this application as a mastodon api type, ready for serialization
|
||||
func (a *Application) ToMasto() *mastotypes.Application {
|
||||
// ToMastoSensitive returns this application as a mastodon api type, ready for serialization
|
||||
func (a *Application) ToMastoSensitive() *mastotypes.Application {
|
||||
return &mastotypes.Application{
|
||||
ID: a.ID,
|
||||
Name: a.Name,
|
||||
@@ -53,3 +53,10 @@ func (a *Application) ToMasto() *mastotypes.Application {
|
||||
VapidKey: a.VapidKey,
|
||||
}
|
||||
}
|
||||
|
||||
func (a *Application) ToMastoPublic() *mastotypes.Application {
|
||||
return &mastotypes.Application{
|
||||
Name: a.Name,
|
||||
Website: a.Website,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user