mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-29 08:09:52 +08:00
refactor(server): rename tx to db (#9867)
This commit is contained in:
@@ -109,7 +109,7 @@ export class PageModel extends BaseModel {
|
||||
if (!data || data.type !== permission) {
|
||||
if (data) {
|
||||
// Update the permission
|
||||
data = await this.tx.workspacePageUserPermission.update({
|
||||
data = await this.db.workspacePageUserPermission.update({
|
||||
where: {
|
||||
workspaceId_pageId_userId: {
|
||||
workspaceId,
|
||||
@@ -121,7 +121,7 @@ export class PageModel extends BaseModel {
|
||||
});
|
||||
} else {
|
||||
// Create a new permission
|
||||
data = await this.tx.workspacePageUserPermission.create({
|
||||
data = await this.db.workspacePageUserPermission.create({
|
||||
data: {
|
||||
workspaceId,
|
||||
pageId,
|
||||
@@ -135,7 +135,7 @@ export class PageModel extends BaseModel {
|
||||
|
||||
// If the new permission is owner, we need to revoke old owner
|
||||
if (permission === Permission.Owner) {
|
||||
await this.tx.workspacePageUserPermission.updateMany({
|
||||
await this.db.workspacePageUserPermission.updateMany({
|
||||
where: {
|
||||
workspaceId,
|
||||
pageId,
|
||||
|
||||
Reference in New Issue
Block a user