Add a delete brand image action on the APIv4 (#9552)

Этот коммит содержится в:
Julien Levesy
2018-10-15 16:46:26 +02:00
коммит произвёл George Goldberg
родитель 160d278592
Коммит 43bdbb0c3a
4 изменённых файлов: 68 добавлений и 0 удалений

Просмотреть файл

@@ -77,3 +77,19 @@ func (a *App) GetBrandImage() ([]byte, *model.AppError) {
return img, nil
}
func (a *App) DeleteBrandImage() *model.AppError {
filePath := BRAND_FILE_PATH + BRAND_FILE_NAME
fileExists, err := a.FileExists(filePath)
if err != nil {
return err
}
if !fileExists {
return model.NewAppError("DeleteBrandImage", "api.admin.delete_brand_image.storage.not_found", nil, "", http.StatusNotFound)
}
return a.RemoveFile(filePath)
}