mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 10:52:25 -05:00
[feature] Implement markers API (#1989)
* Implement markers API Fixes #1856 * Correct import grouping in markers files * Regenerate Swagger for markers API * Shorten names for readability * Cache markers for 6 hours * Update DB ref * Update envparsing.sh
This commit is contained in:
parent
cf4bd700fb
commit
b874e9251e
29 changed files with 1083 additions and 3 deletions
|
|
@ -289,3 +289,15 @@ func ListRepliesPolicy(repliesPolicy gtsmodel.RepliesPolicy) error {
|
|||
return fmt.Errorf("list replies_policy must be either empty or one of 'followed', 'list', 'none'")
|
||||
}
|
||||
}
|
||||
|
||||
// MarkerName checks that the desired marker timeline name is valid.
|
||||
func MarkerName(name string) error {
|
||||
if name == "" {
|
||||
return fmt.Errorf("empty string for marker timeline name not allowed")
|
||||
}
|
||||
switch apimodel.MarkerName(name) {
|
||||
case apimodel.MarkerNameHome, apimodel.MarkerNameNotifications:
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("marker timeline name '%s' was not recognized, valid options are '%s', '%s'", name, apimodel.MarkerNameHome, apimodel.MarkerNameNotifications)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue