Skip to content

Commit

Permalink
Merge pull request #93 from datasci4health/development
Browse files Browse the repository at this point in the history
fix (quest/artifact): don't delete default-quest-image
  • Loading branch information
HeitorMatt authored Sep 11, 2020
2 parents 12fe43a + 19274f9 commit 46b2c4e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/adonisjs/app/Controllers/Http/v1/QuestController.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,13 @@ class QuestController {
await q.artifact().dissociate()
try {
const artifactPath = Helpers.publicPath('/resources/artifacts/quests/') + params.id + '/'
await artifact.delete(trx)
await Drive.delete(artifactPath)

if (artifact.id === 'default-quest-image') {
console.log('Cannot delete default quest image...Moving on...')
} else {
await artifact.delete(trx)
await Drive.delete(artifactPath)
}
} catch (e) {
console.log('Error deleting artifact quest')
console.log(e)
Expand Down

0 comments on commit 46b2c4e

Please sign in to comment.