Skip to content

Commit d06c042

Browse files
Fetch org function needs to return the org (#1)
* Fetch org function needs to return the org * Bump version
1 parent c92f944 commit d06c042

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "propelauth"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
authors = ["support@propelauth.com"]
55
description = "A Rust crate for managing authentication and authorization with support for multi-tenant / B2B products, powered by PropelAuth"
66
keywords = ["authentication", "auth", "authorization", "b2b", "tenant"]

src/propelauth/org.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ use crate::apis::org_service_api::{
44
DisallowSamlParams, FetchOrgParams, FetchOrgsByQueryParams, FetchUsersInOrgParams,
55
RemoveUserFromOrgParams, UpdateOrgParams,
66
};
7-
use crate::models::{
8-
AddUserToOrgRequest, ChangeUserRoleInOrgRequest, CreateOrgRequest, CreateOrgResponse,
9-
FetchOrgsResponse, RemoveUserFromOrgRequest, UpdateOrgRequest, UserPagedResponse,
10-
};
7+
use crate::models::{AddUserToOrgRequest, ChangeUserRoleInOrgRequest, CreateOrgRequest, CreateOrgResponse, FetchOrgResponse, FetchOrgsResponse, RemoveUserFromOrgRequest, UpdateOrgRequest, UserPagedResponse};
118
use crate::propelauth::errors::{
129
CreateOrgError, ErrorsWithNotFound, FetchOrgsByQueryError, FetchUsersInOrgError,
1310
OrgMissingOrRoleError, UpdateOrgError,
@@ -20,7 +17,7 @@ pub struct OrgService<'a> {
2017

2118
impl OrgService<'_> {
2219
/// Fetch an organization by it's ID
23-
pub async fn fetch_org(&self, org_id: String) -> Result<(), ErrorsWithNotFound> {
20+
pub async fn fetch_org(&self, org_id: String) -> Result<FetchOrgResponse, ErrorsWithNotFound> {
2421
if !is_valid_id(&org_id) {
2522
return Err(ErrorsWithNotFound::NotFound);
2623
}
@@ -38,8 +35,7 @@ impl OrgService<'_> {
3835
_ => ErrorsWithNotFound::UnexpectedException,
3936
},
4037
)
41-
})?;
42-
Ok(())
38+
})
4339
}
4440

4541
/// Fetch and page over organizations

0 commit comments

Comments
 (0)