1
0

List item creation is now done via handler

This commit is contained in:
konrad
2018-07-11 02:13:53 +02:00
committed by kolaente
parent b067425dc3
commit 592dc20af4
12 changed files with 114 additions and 18 deletions

View File

@ -159,6 +159,22 @@ func (err ErrNeedToBeListAdmin) Error() string {
return fmt.Sprintf("You need to be list owner to do that [ListID: %d, UserID: %d]", err.ListID, err.UserID)
}
// ErrNeedToBeListWriter represents an error, where the user is not the owner of that list (used i.e. when deleting a list)
type ErrNeedToBeListWriter struct {
ListID int64
UserID int64
}
// IsErrNeedToBeListWriter checks if an error is a ErrListDoesNotExist.
func IsErrNeedToBeListWriter(err error) bool {
_, ok := err.(ErrNeedToBeListWriter)
return ok
}
func (err ErrNeedToBeListWriter) Error() string {
return fmt.Sprintf("You need to have write acces to the list to do that [ListID: %d, UserID: %d]", err.ListID, err.UserID)
}
// ================
// List item errors
// ================