List Backgrounds (#568)
Return the updated list when setting a list background Add swagger docs for unsplash methods Add unsplash info to search results Fix misspell Fix lint Add rights check for setting and getting backgrounds Show unsplash information when loading a single list Make application id for pingbacks configurable Remove old backgrounds when setting a new one Return 404 if the list does not have a background Implement getting list backgrounds Implement actually setting a photo from unsplash as list background go mod tidy Add migration for background file id Roughly implement setting a list background from unsplash Implement saving a background Add migration for unsplash photo table Add unsplash search Fix parsing page param Fix parsing page param Fix background config Add unsplash wrapper library Add enabled background providers to info endpoint Add config options for backgrounds Add unsplash background provider Add routing handler for backgrounds Add basic background provider interface Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/api/pulls/568
This commit is contained in:
@ -50,3 +50,20 @@ func IsErrFileIsTooLarge(err error) bool {
|
||||
_, ok := err.(ErrFileIsTooLarge)
|
||||
return ok
|
||||
}
|
||||
|
||||
// ErrFileIsNotUnsplashFile defines an error where a file is not downloaded from unsplash.
|
||||
// Used in cases whenever unsplash information about a file is requested, but the file was not downloaded from unsplash.
|
||||
type ErrFileIsNotUnsplashFile struct {
|
||||
FileID int64
|
||||
}
|
||||
|
||||
// Error is the error implementation of ErrFileIsNotUnsplashFile
|
||||
func (err ErrFileIsNotUnsplashFile) Error() string {
|
||||
return fmt.Sprintf("file was not downloaded from unsplash [FileID: %d]", err.FileID)
|
||||
}
|
||||
|
||||
//IsErrFileIsNotUnsplashFile checks if an error is ErrFileIsNotUnsplashFile
|
||||
func IsErrFileIsNotUnsplashFile(err error) bool {
|
||||
_, ok := err.(ErrFileIsNotUnsplashFile)
|
||||
return ok
|
||||
}
|
||||
|
Reference in New Issue
Block a user