Skip to content

Commit a7f4fdf

Browse files
committed
move role to user types files
1 parent bba532b commit a7f4fdf

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

src/components/ui/members/member-card.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import { Trash2 } from "lucide-react";
66
import { CoachingRelationshipWithUserNames } from "@/types/coaching_relationship_with_user_names";
77
import { OrganizationStateStore } from "@/lib/stores/organization-state-store";
88
import { AuthStore } from "@/lib/stores/auth-store";
9-
import { Id, Role } from "@/types/general";
9+
import { Id } from "@/types/general";
10+
import { Role } from "@/types/user";
1011

1112
interface MemberCardProps {
1213
firstName: string;

src/components/ui/members/member-container.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { MemberList } from "./member-list";
22
import { AddMemberButton } from "./add-member-button";
33
import { User } from "@/types/user";
4-
import { Role } from "@/types/general";
4+
import { Role } from "@/types/user";
55
import { CoachingRelationshipWithUserNames } from "@/types/coaching_relationship_with_user_names";
66
import { UserSession } from "@/types/user-session";
77

src/types/general.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,6 @@ export enum ItemStatus {
111111
WontDo = "WontDo",
112112
}
113113

114-
export enum Role {
115-
User = "User",
116-
Admin = "Admin"
117-
}
118-
119114
export function stringToActionStatus(statusString: string): ItemStatus {
120115
const status = statusString.trim();
121116

src/types/user-session.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { User } from "@/types/user";
2-
import { Role } from "@/types/general";
1+
import { User, Role } from "@/types/user";
2+
33
/**
44
* This is an intersection type that combines the User type with additional properties.
55
* Currently, it does not add any new properties, but it can be extended in the future

src/types/user.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Id, Role } from "@/types/general";
1+
import { Id } from "@/types/general";
22

33
// This must always reflect the Rust struct on the backend entity::users::Model
44
export interface User {
@@ -25,6 +25,11 @@ export interface NewUserPassword {
2525
confirm_password: string;
2626
}
2727

28+
export enum Role {
29+
User = "User",
30+
Admin = "Admin"
31+
}
32+
2833
export function parseUser(data: unknown): User {
2934
if (!isUser(data)) {
3035
throw new Error("Invalid User object data");

0 commit comments

Comments
 (0)