瀏覽代碼

fix: User destroy hook record reference

Owen Diffey 2 周之前
父節點
當前提交
5a412e4ef9
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      backend/src/modules/DataModule/models/User.ts

+ 1 - 1
backend/src/modules/DataModule/models/User.ts

@@ -335,7 +335,7 @@ export const setup = async () => {
 	User.addHook("beforeDestroy", async (record: User, options) => {
 		await Session.destroy({
 			where: {
-				userId: user._id
+				userId: record._id
 			},
 			individualHooks: true,
 			transaction: options.transaction