Skip to content

Commit

Permalink
Add RootPath::new
Browse files Browse the repository at this point in the history
  • Loading branch information
bouzuya committed Nov 3, 2023
1 parent 256f20e commit b1b55de
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rust/crates/web/src/infra/firestore/path.rs
Expand Up @@ -154,6 +154,14 @@ pub struct RootPath {
}

impl RootPath {
pub fn new(project_id: String, database_id: String) -> Result<Self, Error> {
// 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,
Expand Down

0 comments on commit b1b55de

Please sign in to comment.