Return success from media upload

This commit is contained in:
2023-07-02 09:49:41 +10:00
parent 007e22a34f
commit 93041ee207

View File

@@ -23,8 +23,14 @@ module Adamantium
return Failure(:invalid_file_type) unless VALID_UPLOAD_TYPES.include? type
save_image(file: file) if IMAGE_TYPES.include? type
save_video(file: file) if VIDEO_TYPES.include? type
result = save_image(file: file) if IMAGE_TYPES.include? type
result = save_video(file: file) if VIDEO_TYPES.include? type
if result.success?
Success(result.value!)
else
Failure()
end
end
private