Skip to content

Commit 82e5916

Browse files
chore: wip
1 parent c04a6c4 commit 82e5916

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

app/Actions/NotifyUser.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import type { RequestInstance } from '@stacksjs/types'
2+
import { Action } from '@stacksjs/actions'
3+
4+
export default new Action({
5+
name: 'NotifyUser',
6+
description: 'Notify User After Creation',
7+
method: 'GET',
8+
async handle(request: RequestInstance) {
9+
console.log('test')
10+
},
11+
})

app/Listener.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async function listenEvents(type: keyof typeof events, event: any) {
2020
}
2121
else {
2222
try {
23-
const actionModule = await import(p.projectPath(`Actions/${eventListener}.ts`))
23+
const actionModule = await import(p.appPath(`Actions/${eventListener}.ts`))
2424
await actionModule.default.handle(event)
2525
}
2626
catch (error) {

storage/framework/actions/src/UserShowOrmAction.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ export default new Action({
1010
async handle(request: UserRequestType) {
1111
const id = request.getParam('id')
1212

13-
const result = await User.find(Number(id))
13+
const result = await User.create({
14+
name: 'Glenn',
15+
email: 'gtorregosa@gmail.com',
16+
password: '123456',
17+
job_title: 'test',
18+
})
1419

1520
return response.json(result)
1621
},

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@ import type {
33
AttributesElements,
44
BaseBelongsToMany,
55
BaseHasOneThrough,
6-
BelongsToMany,
76
FieldArrayElement,
8-
HasOne,
9-
HasOneThrough,
107
Model,
118
ModelElement,
129
ModelNames,
1310
Relation,
1411
RelationConfig,
15-
Relations,
1612
TableNames,
1713
} from '@stacksjs/types'
1814
import { generator, parser, traverse } from '@stacksjs/build'

0 commit comments

Comments
 (0)