1
0

feat: rename lists to projects

This commit is contained in:
kolaente
2022-11-13 17:07:01 +01:00
parent 73244e7d85
commit 96a0f5e169
8 changed files with 76 additions and 73 deletions

View File

@ -54,9 +54,11 @@ func (p *Provider) Search(_ *xorm.Session, _ string, _ int64) (result []*backgro
// @Router /projects/{id}/backgrounds/upload [put]
func (p *Provider) Set(s *xorm.Session, img *background.Image, project *models.Project, _ web.Auth) (err error) {
// Remove the old background if one exists
err = project.DeleteBackgroundFileIfExists()
if err != nil {
return err
if project.BackgroundFileID != 0 {
file := files.File{ID: project.BackgroundFileID}
if err := file.Delete(); err != nil {
return err
}
}
file := &files.File{}