diff --git a/app/Actions/Dashboard/GetDeploymentCount.ts b/app/Actions/Dashboard/GetDeploymentCount.ts index fb27d83824..58d442aca0 100644 --- a/app/Actions/Dashboard/GetDeploymentCount.ts +++ b/app/Actions/Dashboard/GetDeploymentCount.ts @@ -1,5 +1,5 @@ import { Action } from '@stacksjs/actions' -import { Deployment } from '@stacksjs/orm' +// import { Deployment } from '@stacksjs/orm' export default new Action({ name: 'GetDeploymentCount', @@ -7,6 +7,6 @@ export default new Action({ apiResponse: true, async handle() { - return Deployment.count() + // return Deployment.count() }, }) diff --git a/app/Actions/Dashboard/GetDownloadCount.ts b/app/Actions/Dashboard/GetDownloadCount.ts index 3cf7aaaa8a..8bc96790ce 100644 --- a/app/Actions/Dashboard/GetDownloadCount.ts +++ b/app/Actions/Dashboard/GetDownloadCount.ts @@ -1,5 +1,5 @@ import { Action } from '@stacksjs/actions' -import { Library } from '@stacksjs/orm' +// import { Library } from '@stacksjs/orm' export default new Action({ name: 'GetDownloadCount', @@ -7,6 +7,6 @@ export default new Action({ apiResponse: true, async handle() { - return Library.downloadCount() + // return Library.downloadCount() }, }) diff --git a/app/Actions/Dashboard/GetRecentCommits.ts b/app/Actions/Dashboard/GetRecentCommits.ts index 94c4342880..33df279865 100644 --- a/app/Actions/Dashboard/GetRecentCommits.ts +++ b/app/Actions/Dashboard/GetRecentCommits.ts @@ -1,5 +1,5 @@ import { Action } from '@stacksjs/actions' -import { Commit } from '@stacksjs/orm' +// import { Commit } from '@stacksjs/orm' export default new Action({ name: 'GetRecentCommits', @@ -7,6 +7,6 @@ export default new Action({ apiResponse: true, async handle() { - return Commit.recent(3) + // return Commit.recent(3) }, }) diff --git a/app/Actions/Dashboard/GetRecentDeployments.ts b/app/Actions/Dashboard/GetRecentDeployments.ts index bbeeec0da9..eb5fc1babc 100644 --- a/app/Actions/Dashboard/GetRecentDeployments.ts +++ b/app/Actions/Dashboard/GetRecentDeployments.ts @@ -1,5 +1,5 @@ import { Action } from '@stacksjs/actions' -import { Deployment } from '@stacksjs/orm' +// import { Deployment } from '@stacksjs/orm' export default new Action({ name: 'GetRecentDeployments', @@ -7,6 +7,6 @@ export default new Action({ apiResponse: true, async handle() { - return Deployment.recent(3) + // return Deployment.recent(3) }, }) diff --git a/app/Actions/Dashboard/GetSubscriberCount.ts b/app/Actions/Dashboard/GetSubscriberCount.ts index b3eb6fe60a..c42b6e9a20 100644 --- a/app/Actions/Dashboard/GetSubscriberCount.ts +++ b/app/Actions/Dashboard/GetSubscriberCount.ts @@ -1,5 +1,5 @@ import { Action } from '@stacksjs/actions' -import { Subscriber } from '@stacksjs/orm' +// import { Subscriber } from '@stacksjs/orm' export default new Action({ name: 'GetSubscriberCount', @@ -7,6 +7,6 @@ export default new Action({ apiResponse: true, async handle() { - return Subscriber.count() + // return Subscriber.count() }, }) diff --git a/app/Actions/Dashboard/GetTotalUsers.ts b/app/Actions/Dashboard/GetTotalUsers.ts index 09164fe7b5..3db2af6e5c 100644 --- a/app/Actions/Dashboard/GetTotalUsers.ts +++ b/app/Actions/Dashboard/GetTotalUsers.ts @@ -1,5 +1,5 @@ import { Action } from '@stacksjs/actions' -import { User } from '@stacksjs/orm' +// import { User } from '@stacksjs/orm' export default new Action({ name: 'GetTotalUsers', @@ -7,6 +7,6 @@ export default new Action({ apiResponse: true, async handle() { - return User.count() + // return User.count() }, }) diff --git a/app/Actions/LogAction.ts b/app/Actions/LogAction.ts index b3a66ff91a..5e5e782825 100644 --- a/app/Actions/LogAction.ts +++ b/app/Actions/LogAction.ts @@ -1,6 +1,6 @@ import { Action } from '@stacksjs/actions' import { log } from '@stacksjs/logging' -import { rule } from '@stacksjs/validation' +import { schema } from '@stacksjs/validation' interface Request { message: string @@ -14,12 +14,12 @@ export default new Action({ // the request object is optional, but if it is provided, it will be used for validation fields: { message: { - rule: rule.string().minLength(3).maxLength(255), + rule: schema.string().minLength(3).maxLength(255), message: 'The message must be between 3 and 255 characters long.', }, level: { - rule: rule.enum(['info', 'warn', 'error']), + rule: schema.enum(['info', 'warn', 'error']), message: 'The log level must be one of "info", "warn", or "error".', }, }, diff --git a/bun.lockb b/bun.lockb index 4f44be3096..2417607776 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/storage/framework/core/actions/src/helpers/utils.ts b/storage/framework/core/actions/src/helpers/utils.ts index aeddb5273e..fc16c096e6 100644 --- a/storage/framework/core/actions/src/helpers/utils.ts +++ b/storage/framework/core/actions/src/helpers/utils.ts @@ -26,14 +26,12 @@ export async function runAction(action: string, options?: ActionOptions) { if (file === `${action}.ts` || file.endsWith(`${action}.ts`)) return ((await import(p.userActionsPath(file))).default as Action).handle() - // console.log('model', model.name) - // WIP: if (model.name === action) return await model.handle() - - // const a = await import(p.userActionsPath(file)) - // if (a.name === action) return await a.handle() + // if a custom model name is used, we need to check for it + const a = await import(p.userActionsPath(file)) + if (a.name === action) return await a.handle() } - // or else, just run the action normally by assuming it's stored in p.actionsPath + // or else, just run the action normally by assuming the action is core Action, stored in p.actionsPath const opts = buddyOptions() const path = p.relativeActionsPath(`src/${action}.ts`) const cmd = `bun --bun ${path} ${opts}`.trimEnd()