From 0650030d2386c7a202a844312485a83941433480 Mon Sep 17 00:00:00 2001 From: Zokhoi <20432565+Zokhoi@users.noreply.github.com> Date: Wed, 25 Sep 2024 02:51:44 +0800 Subject: [PATCH] Rename variables --- deepwell/src/endpoints/parent.rs | 4 ++-- deepwell/src/services/parent/structs.rs | 4 ++-- framerail/src/lib/server/deepwell/page.ts | 8 ++++---- framerail/src/routes/[slug]/[...extra]/+server.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/deepwell/src/endpoints/parent.rs b/deepwell/src/endpoints/parent.rs index bf76d229b5..80ce6f3077 100644 --- a/deepwell/src/endpoints/parent.rs +++ b/deepwell/src/endpoints/parent.rs @@ -126,7 +126,7 @@ pub async fn parent_modify( input.child, input.site_id, ); - let creation = match input.added { + let creation = match input.add { Some(parents) => { let mut creation = Vec::new(); for parent in parents { @@ -148,7 +148,7 @@ pub async fn parent_modify( None => None, }; - let removal = match input.removed { + let removal = match input.remove { Some(parents) => { let mut removal = Vec::new(); for parent in parents { diff --git a/deepwell/src/services/parent/structs.rs b/deepwell/src/services/parent/structs.rs index 3c71694ccf..e8cc9eda88 100644 --- a/deepwell/src/services/parent/structs.rs +++ b/deepwell/src/services/parent/structs.rs @@ -33,8 +33,8 @@ pub struct ParentDescription<'a> { pub struct ParentModifyDescription<'a> { pub site_id: i64, pub child: Reference<'a>, - pub added: Option>>, - pub removed: Option>>, + pub add: Option>>, + pub remove: Option>>, } #[derive(Serialize, Deserialize, Debug, Copy, Clone, Hash, PartialEq, Eq)] diff --git a/framerail/src/lib/server/deepwell/page.ts b/framerail/src/lib/server/deepwell/page.ts index dc43742199..8233788b61 100644 --- a/framerail/src/lib/server/deepwell/page.ts +++ b/framerail/src/lib/server/deepwell/page.ts @@ -170,15 +170,15 @@ export async function pageParentModify( siteId: number, pageId: number, userId: number, - removed: string[], - added: string[] + add: string[], + remove: string[] ): Promise { return client.request("parent_modify", { site_id: siteId, child: pageId, user_id: userId, - removed, - added + add, + remove }) } diff --git a/framerail/src/routes/[slug]/[...extra]/+server.ts b/framerail/src/routes/[slug]/[...extra]/+server.ts index 464df86b29..55de96b4eb 100644 --- a/framerail/src/routes/[slug]/[...extra]/+server.ts +++ b/framerail/src/routes/[slug]/[...extra]/+server.ts @@ -115,7 +115,7 @@ export async function POST(event) { if (!common.includes(newParent[i])) added.push(newParent[i]) } - res = await page.pageParentModify(siteId, pageId, session?.user_id, removed, added) + res = await page.pageParentModify(siteId, pageId, session?.user_id, added, removed) } else if (extra.includes("parentget")) { res = await page.pageParentGet(siteId, pageId, slug) } else if (extra.includes("score")) {