From cee05b13e8df4831eafc48e443269cba6ead3e53 Mon Sep 17 00:00:00 2001 From: linonetwo Date: Thu, 9 Feb 2023 20:01:11 +0800 Subject: [PATCH] fix: user_id is string now --- client-app/src-tauri/types/src/workspace.rs | 3 +-- packages/data-center/src/provider/tauri-ipc/index.ts | 2 ++ .../src/provider/tauri-ipc/ipc/types/workspace.json | 3 +-- .../data-center/src/provider/tauri-ipc/ipc/types/workspace.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client-app/src-tauri/types/src/workspace.rs b/client-app/src-tauri/types/src/workspace.rs index 88b92477c..7dde3debe 100644 --- a/client-app/src-tauri/types/src/workspace.rs +++ b/client-app/src-tauri/types/src/workspace.rs @@ -4,8 +4,7 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] pub struct CreateWorkspace { - // TODO: make all id string, on Octobase side, and rewrite all related tests - pub user_id: i32, + pub user_id: String, /** * only set name, avatar is update in datacenter to yDoc directly */ diff --git a/packages/data-center/src/provider/tauri-ipc/index.ts b/packages/data-center/src/provider/tauri-ipc/index.ts index 1108dddba..4412cc1f1 100644 --- a/packages/data-center/src/provider/tauri-ipc/index.ts +++ b/packages/data-center/src/provider/tauri-ipc/index.ts @@ -121,6 +121,7 @@ export class TauriIPCProvider extends LocalProvider { ): Promise { this._logger('Creating client app workspace'); assert(this.#ipc); + assert(this.#userID); const { id } = await this.#ipc.createWorkspace({ name: meta.name, // TODO: get userID here @@ -151,6 +152,7 @@ export class TauriIPCProvider extends LocalProvider { override async loadWorkspaces(): Promise { assert(this.#ipc); + assert(this.#userID); const { workspaces } = await this.#ipc.getWorkspaces({ user_id: this.#userID, }); diff --git a/packages/data-center/src/provider/tauri-ipc/ipc/types/workspace.json b/packages/data-center/src/provider/tauri-ipc/ipc/types/workspace.json index 9bfe0226a..88ed9e514 100644 --- a/packages/data-center/src/provider/tauri-ipc/ipc/types/workspace.json +++ b/packages/data-center/src/provider/tauri-ipc/ipc/types/workspace.json @@ -83,8 +83,7 @@ "type": "string" }, "user_id": { - "type": "integer", - "format": "int32" + "type": "string" } } }, diff --git a/packages/data-center/src/provider/tauri-ipc/ipc/types/workspace.ts b/packages/data-center/src/provider/tauri-ipc/ipc/types/workspace.ts index d7bacee60..025a1befb 100644 --- a/packages/data-center/src/provider/tauri-ipc/ipc/types/workspace.ts +++ b/packages/data-center/src/provider/tauri-ipc/ipc/types/workspace.ts @@ -34,7 +34,7 @@ export interface CreateWorkspace { * only set name, avatar is update in datacenter to yDoc directly */ name: string; - user_id: number; + user_id: string; [k: string]: unknown; } export interface GetWorkspace {