Implemented Create and Update methods on list
This commit is contained in:
@ -143,19 +143,19 @@ func (err ErrListDoesNotExist) Error() string {
|
||||
return fmt.Sprintf("List does not exist [ID: %d]", err.ID)
|
||||
}
|
||||
|
||||
// ErrNeedToBeListOwner represents an error, where the user is not the owner of that list (used i.e. when deleting a list)
|
||||
type ErrNeedToBeListOwner struct {
|
||||
// ErrNeedToBeListAdmin represents an error, where the user is not the owner of that list (used i.e. when deleting a list)
|
||||
type ErrNeedToBeListAdmin struct {
|
||||
ListID int64
|
||||
UserID int64
|
||||
}
|
||||
|
||||
// IsErrListDoesNotExist checks if an error is a ErrListDoesNotExist.
|
||||
func IsErrNeedToBeListOwner(err error) bool {
|
||||
_, ok := err.(ErrNeedToBeListOwner)
|
||||
func IsErrNeedToBeListAdmin(err error) bool {
|
||||
_, ok := err.(ErrNeedToBeListAdmin)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (err ErrNeedToBeListOwner) Error() string {
|
||||
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)
|
||||
}
|
||||
|
||||
@ -289,3 +289,4 @@ func IsErrUserDoesNotHaveWriteAccessToNamespace(err error) bool {
|
||||
func (err ErrUserDoesNotHaveWriteAccessToNamespace) Error() string {
|
||||
return fmt.Sprintf("You need to have write access to this namespace to do that [NamespaceID: %d, UserID: %d]", err.NamespaceID, err.UserID)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user