fix: user_id is string now

This commit is contained in:
linonetwo
2023-02-09 20:01:11 +08:00
parent ca060dbf7a
commit cee05b13e8
4 changed files with 5 additions and 5 deletions

View File

@@ -4,8 +4,7 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
pub struct CreateWorkspace { pub struct CreateWorkspace {
// TODO: make all id string, on Octobase side, and rewrite all related tests pub user_id: String,
pub user_id: i32,
/** /**
* only set name, avatar is update in datacenter to yDoc directly * only set name, avatar is update in datacenter to yDoc directly
*/ */

View File

@@ -121,6 +121,7 @@ export class TauriIPCProvider extends LocalProvider {
): Promise<WorkspaceUnit | undefined> { ): Promise<WorkspaceUnit | undefined> {
this._logger('Creating client app workspace'); this._logger('Creating client app workspace');
assert(this.#ipc); assert(this.#ipc);
assert(this.#userID);
const { id } = await this.#ipc.createWorkspace({ const { id } = await this.#ipc.createWorkspace({
name: meta.name, name: meta.name,
// TODO: get userID here // TODO: get userID here
@@ -151,6 +152,7 @@ export class TauriIPCProvider extends LocalProvider {
override async loadWorkspaces(): Promise<WorkspaceUnit[]> { override async loadWorkspaces(): Promise<WorkspaceUnit[]> {
assert(this.#ipc); assert(this.#ipc);
assert(this.#userID);
const { workspaces } = await this.#ipc.getWorkspaces({ const { workspaces } = await this.#ipc.getWorkspaces({
user_id: this.#userID, user_id: this.#userID,
}); });

View File

@@ -83,8 +83,7 @@
"type": "string" "type": "string"
}, },
"user_id": { "user_id": {
"type": "integer", "type": "string"
"format": "int32"
} }
} }
}, },

View File

@@ -34,7 +34,7 @@ export interface CreateWorkspace {
* only set name, avatar is update in datacenter to yDoc directly * only set name, avatar is update in datacenter to yDoc directly
*/ */
name: string; name: string;
user_id: number; user_id: string;
[k: string]: unknown; [k: string]: unknown;
} }
export interface GetWorkspace { export interface GetWorkspace {