Skip to content

Commit 52ad900

Browse files
chore: wip
1 parent 888c0a9 commit 52ad900

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

storage/framework/actions/src/LogDestroyOrmAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default new Action({
1313

1414
const model = await Log.findOrFail(id)
1515

16-
model.delete()
16+
model?.delete()
1717

1818
return response.json({ message: 'Model deleted!' })
1919
},

storage/framework/actions/src/LogUpdateOrmAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default new Action({
1414
const id = request.getParam<number>('id')
1515
const model = await Log.findOrFail(id)
1616

17-
const result = model.update(request.all())
17+
const result = model?.update(request.all())
1818

1919
return response.json(result)
2020
},

storage/framework/actions/src/RequestDestroyOrmAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default new Action({
1313

1414
const model = await Request.findOrFail(id)
1515

16-
model.delete()
16+
model?.delete()
1717

1818
return response.json({ message: 'Model deleted!' })
1919
},

storage/framework/actions/src/RequestUpdateOrmAction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default new Action({
1414
const id = request.getParam<number>('id')
1515
const model = await Request.findOrFail(id)
1616

17-
const result = model.update(request.all())
17+
const result = model?.update(request.all())
1818

1919
return response.json(result)
2020
},

storage/framework/core/orm/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ export async function writeOrmActions(apiRoute: string, modelName: string, actio
842842
843843
const model = await ${modelName}.findOrFail(id)
844844
845-
model.delete()
845+
model?.delete()
846846
847847
return response.json({ message: 'Model deleted!' })
848848
},`

0 commit comments

Comments
 (0)