You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Couldn't get decorators to work in pinia-orm-play.codedredd.de. Let me know if you need a proper reproduction.
Below is the code snippet from my project. Relevant line is the line that starts with @Uid. When I remove the alphabet parameter ,pinia ORM generates UIDs properly.
import { Model } from 'pinia-orm'
import { Attr, Num, Str, Uid, HasMany } from 'pinia-orm/decorators'
import { UnitEntity } from '@/stores/units'
export class ReportingParty {
constructor(
public firstName: string,
public middleName: string,
public lastName: string,
public howReported: string,
public callbackPhone: string,
public fromPhone: string,
public reportingPartyLocation: string
) {}
}
export class CadEventEntity extends Model {
static readonly entity: string = 'cadEventEntities'
@Uid({ size: 3, alphabet: '0123456789' }) declare id: string
@Attr(Date) declare createdAt: Date
@Str('') declare eventType: string
@Num(7) declare priority: number
@Str('') declare location: string
@Str('') declare narrative: string
@Attr([ReportingParty]) declare reportingParties: ReportingParty[]
@HasMany(() => UnitEntity, 'assignedEventId') declare assignedUnits: UnitEntity[]
// TODO: add comments/event history items
}
Describe the bug
Setting custom alphabet results in some characters of UID getting generated as "undefined"
Ex:
Expected UID: 123
Actual UID: undefined2undefined or undefinedundefined3 or 1undefinedundefined
Environment
Vue, no Nuxt
Dependencies:
Reproduction
Couldn't get decorators to work in pinia-orm-play.codedredd.de. Let me know if you need a proper reproduction.
Below is the code snippet from my project. Relevant line is the line that starts with
@Uid
. When I remove the alphabet parameter ,pinia ORM generates UIDs properly.Describe the bug
Setting custom alphabet results in some characters of UID getting generated as "undefined"
Ex:
Expected UID:
123
Actual UID:
undefined2undefined
orundefinedundefined3
or1undefinedundefined
Additional context
Here is a link to the problem file in my project's repo in case that helps. Let me know if there's anything I can do to gather and condense diagnostic information.
https://github.com/memtech3/dispatchSystem/blob/main/vue-frontend/src/stores/cadEvents.ts
Logs
No response
The text was updated successfully, but these errors were encountered: