Skip to content

Commit

Permalink
fixed: build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgobich committed Dec 22, 2024
1 parent f57bc21 commit c3d74c5
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 18 deletions.
1 change: 0 additions & 1 deletion app/dtos/session_log.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { BaseModelDto } from '@adocasts.com/dto/base'
import SessionLog from '#models/session_log'
import UserDto from '#dtos/user'
import type { UAParser } from 'ua-parser-js'

export default class SessionLogDto extends BaseModelDto {
declare id: number
Expand Down
14 changes: 7 additions & 7 deletions app/models/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Profile from '#models/profile'
import AppBaseModel from '#models/app_base_model'
import NotificationTypes from '#enums/notification_types'
import NotImplementedException from '#exceptions/not_implemented_exception'
import Emitter from '@adonisjs/core/services/emitter'

export default class Notification extends AppBaseModel {
@column({ isPrimary: true })
Expand Down Expand Up @@ -103,14 +102,15 @@ export default class Notification extends AppBaseModel {
}

async trySendEmail(
userId: number,
trx: TransactionClientContract | undefined | null = undefined
_userId: number,
_trx: TransactionClientContract | undefined | null = undefined
) {
const user = await User.query().where({ id: userId }).preload('profile').firstOrFail()
throw new NotImplementedException('Email notification sending is not implemented yet')
// const user = await User.query().where({ id: userId }).preload('profile').firstOrFail()

if (!this.isEmailEnabled(user.profile)) return
if (!trx) return Emitter.emit('notification:send', { notification: this, user })
// if (!this.isEmailEnabled(user.profile)) return
// if (!trx) return emitter.emit('notification:send', { notification: this, user })

trx.on('commit', () => Emitter.emit('notification:send', { notification: this, user }))
// trx.on('commit', () => emitter.emit('notification:send', { notification: this, user }))
}
}
4 changes: 0 additions & 4 deletions components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,8 @@ declare module 'vue' {
DropdownMenuSubContent: typeof import('./inertia/components/ui/dropdown-menu/DropdownMenuSubContent.vue')['default']
DropdownMenuSubTrigger: typeof import('./inertia/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue')['default']
DropdownMenuTrigger: typeof import('./inertia/components/ui/dropdown-menu/DropdownMenuTrigger.vue')['default']
FilePicker: typeof import('./inertia/components/FilePicker.vue')['default']
FormDialog: typeof import('./inertia/components/FormDialog.vue')['default']
FormInput: typeof import('./inertia/components/FormInput.vue')['default']
ImageUpload: typeof import('./inertia/components/ImageUpload.vue')['default']
Input: typeof import('./inertia/components/ui/input/Input.vue')['default']
Label: typeof import('./inertia/components/ui/label/Label.vue')['default']
Menubar: typeof import('./inertia/components/ui/menubar/Menubar.vue')['default']
Expand Down Expand Up @@ -168,10 +166,8 @@ declare module 'vue' {
TagsInputItemText: typeof import('./inertia/components/ui/tags-input/TagsInputItemText.vue')['default']
TaxonomyTags: typeof import('./inertia/components/TaxonomyTags.vue')['default']
Textarea: typeof import('./inertia/components/ui/textarea/Textarea.vue')['default']
TipTapCodeBlockNode: typeof import('./inertia/components/TipTapCodeBlockNode.vue')['default']
TipTapCommandPallete: typeof import('./inertia/components/TipTapCommandPallete.vue')['default']
TipTapEditor: typeof import('./inertia/components/TipTapEditor.vue')['default']
TipTipCodeBlockNode: typeof import('./inertia/components/TipTipCodeBlockNode.vue')['default']
ToastManager: typeof import('./inertia/components/ToastManager.vue')['default']
Tooltip: typeof import('./inertia/components/ui/tooltip/Tooltip.vue')['default']
TooltipContent: typeof import('./inertia/components/ui/tooltip/TooltipContent.vue')['default']
Expand Down
11 changes: 5 additions & 6 deletions database/factories/collection_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import { PostFactory } from '#factories/post_factory'
import { AssetFactory } from '#factories/asset_factory'
import CollectionTypes from '#enums/collection_types'

export const CollectionFactory = Factory
.define(Collection, ({ faker }) => ({
name: faker.commerce.productName(),
description: faker.lorem.sentence(),
collectionTypeId: CollectionTypes.SERIES
}))
export const CollectionFactory = Factory.define(Collection, ({ faker }) => ({
name: faker.commerce.productName(),
description: faker.lorem.sentence(),
collectionTypeId: CollectionTypes.SERIES,
}))
.relation('owner', () => UserFactory)
.relation('posts', () => PostFactory)
.relation('children', () => CollectionFactory)
Expand Down
8 changes: 8 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"#abilities/*": "./app/abilities/*.js",
"#strategies/*": "./app/strategies/*.js",
"#database/*": "./database/*.js",
"#factories/*": "./database/factories/*.js",
"#tests/*": "./tests/*.js",
"#start/*": "./start/*.js",
"#config/*": "./config/*.js"
Expand All @@ -44,6 +45,7 @@
"@japa/plugin-adonisjs": "^3.0.1",
"@japa/runner": "^3.1.4",
"@swc/core": "1.7.26",
"@types/dinero.js": "^1.9.4",
"@types/js-cookie": "^3.0.6",
"@types/luxon": "^3.4.2",
"@types/node": "^22.7.5",
Expand Down

0 comments on commit c3d74c5

Please sign in to comment.