From b1b55de62a8f69183cce4f0315afdac1952f7aa4 Mon Sep 17 00:00:00 2001 From: bouzuya Date: Fri, 3 Nov 2023 14:14:52 +0900 Subject: [PATCH] Add RootPath::new --- rust/crates/web/src/infra/firestore/path.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rust/crates/web/src/infra/firestore/path.rs b/rust/crates/web/src/infra/firestore/path.rs index 782df97..233d048 100644 --- a/rust/crates/web/src/infra/firestore/path.rs +++ b/rust/crates/web/src/infra/firestore/path.rs @@ -154,6 +154,14 @@ pub struct RootPath { } impl RootPath { + pub fn new(project_id: String, database_id: String) -> Result { + // TODO: check project_id and database_id format + Ok(Self { + database_id, + project_id, + }) + } + pub fn collection(self, collection_id: String) -> CollectionPath { CollectionPath { id: collection_id,