Improve peformance of search indexing, v2 fixes + new routes (#205)

* Refactor search to not spam the database with queries, new utility routes for V2

* Run prepare
This commit is contained in:
Geometrically
2021-06-02 18:33:11 -07:00
committed by GitHub
parent 16db28060c
commit 157962e42a
18 changed files with 833 additions and 763 deletions

View File

@@ -1,5 +1,5 @@
use super::ids::Base62Id;
use crate::models::users::UserId;
use crate::models::users::User;
use serde::{Deserialize, Serialize};
/// The ID of a team
@@ -47,8 +47,8 @@ impl Default for Permissions {
pub struct TeamMember {
/// The ID of the team this team member is a member of
pub team_id: TeamId,
/// The ID of the user associated with the member
pub user_id: UserId,
/// The user associated with the member
pub user: User,
/// The role of the user in the team
pub role: String,
/// A bitset containing the user's permissions in this team

View File

@@ -8,7 +8,7 @@ pub struct UserId(pub u64);
pub const DELETED_USER: UserId = UserId(127155982985829);
#[derive(Serialize, Deserialize)]
#[derive(Serialize, Deserialize, Clone)]
pub struct User {
pub id: UserId,
pub github_id: Option<u64>,
@@ -21,7 +21,7 @@ pub struct User {
pub role: Role,
}
#[derive(Serialize, Deserialize, PartialEq, Eq)]
#[derive(Serialize, Deserialize, PartialEq, Eq, Clone)]
#[serde(rename_all = "lowercase")]
pub enum Role {
Developer,