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
I try to implement a custom user system but I have an error
AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: config.handle must be a function
at new Model (/var/task/node_modules/.pnpm/[email protected]/node_modules/think-model/lib/model.js:25:5)
at model (/var/task/node_modules/.pnpm/[email protected]/node_modules/think-model/index.js:32:22)
at module.exports.injectModel [as model] (/var/task/node_modules/.pnpm/[email protected]/node_modules/think-model/index.js:47:22)
at module.exports.count (/var/task/CustomModel.cjs:64:27)
at module.exports.getCommentList (/var/task/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@waline/vercel/src/controller/comment.js:403:49)
at module.exports.getAction (/var/task/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@waline/vercel/src/controller/comment.js:90:27)
at /var/task/node_modules/.pnpm/[email protected]/node_modules/think-controller/index.js:55:32
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: false,
expected: true,
operator: '=='
}
this my index.cjs
const Application = require('@waline/vercel');
const CustomModel = require('./CustomModel.cjs');
module.exports = Application({
env: 'development',
model: (tableName) => {
if(tableName !== 'Users') {
return
}
return new CustomModel(tableName)
},
plugins: [],
async postSave(comment) {
// do what ever you want after comment saved
},
});
i am trying to debug in file /lib/model.js in think-model when the model function is added, the config is empty.
what is the correct way to use a custom user system ?
Discussed in https://github.com/orgs/walinejs/discussions/2637
Originally posted by yudaapratama July 28, 2024
Describe the bug | 问题描述
I try to implement a custom user system but I have an error
this my index.cjs
i am trying to debug in file /lib/model.js in think-model when the model function is added, the config is empty.
what is the correct way to use a custom user system ?
Website URL | 问题网站
https://waline-server-test.vercel.app/
Where your waline deploy? | 服务部署在哪里?
Vercel (Default)
Where your comment data store? | 数据存储在哪里?
MySQL
The text was updated successfully, but these errors were encountered: