如何解决如何在next-auth的扩展模型上做CRUD?
这是我的用户模型,它已扩展且工作正常,唯一我仍然不知道如何使用此模型在 nextjs 应用程序的任何其他 API 路由中手动执行 CRUD? 我想在我的其他 API 路由中创建条带会话时更新条带会话 ID。
// Extend the built-in models using class inheritance
export default class User extends Adapters.TypeORM.Models.User.model {
// You can extend the options in a model but you should not remove the base
// properties or change the order of the built-in options on the constructor
constructor(name,email,image,emailVerified) {
super(name,emailVerified);
}
}
export const UserSchema = {
name: "User",target: User,columns: {
...Adapters.TypeORM.Models.User.schema.columns,// Adds a phoneNumber to the User schema
stripeSessionId: {
type: "string",nullable: true,},subcriptionId: {
type: "string",};
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。