Skip to content

Commit c3a70f7

Browse files
committed
chore: wip
1 parent c78315c commit c3a70f7

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

bun.lockb

872 Bytes
Binary file not shown.

storage/framework/core/actions/src/helpers/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ export async function runAction(action: Action, options?: ActionOptions) {
2727
for await (const file of glob.scan(scanOptions)) {
2828
log.debug('file', file)
2929
if (file === `${action}.ts` || file.endsWith(`${action}.ts`))
30-
return ((await import(p.userActionsPath(file))).default as ActionType).handle()
30+
return ((await import(/* @vite-ignore */p.userActionsPath(file))).default as ActionType).handle()
3131

3232
// if a custom model name is used, we need to check for it
33-
const a = await import(p.userActionsPath(file))
33+
const a = await import(/* @vite-ignore */p.userActionsPath(file))
3434
if (a.name === action) return await a.handle()
3535
}
3636

storage/framework/core/validation/src/validator.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,21 @@ interface RequestData {
99
}
1010

1111
export async function validateField(modelFile: string, params: RequestData): Promise<void> {
12-
1312
console.log(params)
14-
const model = (await import(path.userModelsPath(modelFile))).default
13+
const model = (await import(/* @vite-ignore */path.userModelsPath(modelFile))).default as Model
1514
const attributes = model.attributes
1615

1716
const ruleObject: Record<string, SchemaTypes> = {}
1817
const messageObject: Record<string, string> = {}
1918

2019
for (const key in attributes) {
21-
// biome-ignore lint/suspicious/noPrototypeBuiltins: <explanation>
2220
if (attributes.hasOwnProperty(key)) {
23-
ruleObject[key] = attributes[key].validator.rule
24-
25-
const validatorMessages = attributes[key].validator.message
21+
ruleObject[key] = attributes[key]?.validation?.rule
22+
const validatorMessages = attributes[key]?.validation?.message
2623

2724
for (const validatorMessageKey in validatorMessages) {
2825
const validatorMessageString = `${key}.${validatorMessageKey}`
29-
30-
messageObject[validatorMessageString] = attributes[key].validator.message[validatorMessageKey]
26+
messageObject[validatorMessageString] = attributes[key]?.validation?.message[validatorMessageKey]
3127
}
3228
}
3329
}

0 commit comments

Comments
 (0)