Skip to content

Commit accebcf

Browse files
committed
address review comments
1 parent 9815105 commit accebcf

File tree

14 files changed

+661
-422
lines changed

14 files changed

+661
-422
lines changed

package-lock.json

Lines changed: 638 additions & 399 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/organizations/[id]/members/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default function MembersPage({
6666

6767
return (
6868
<div className="container mx-auto p-6 space-y-8">
69-
<h1 className="text-3xl font-bold">Members</h1>
69+
<h3 className="text-3xl font-bold">Members</h3>
7070
<MemberContainer
7171
users={users}
7272
relationships={relationships}

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ 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 } from "@/types/general";
910

1011
interface MemberCardProps {
1112
firstName: string;
1213
lastName: string;
13-
email?: string;
14-
userId: string;
14+
email: string;
15+
userId: Id;
1516
userRelationships: CoachingRelationshipWithUserNames[];
1617
onRefresh: () => void;
1718
}
@@ -43,10 +44,10 @@ export function MemberCard({
4344

4445
try {
4546
await deleteUser(currentOrganizationId, userId);
46-
onRefresh(); // Call refresh after successful deletion
47+
onRefresh();
4748
} catch (error) {
4849
console.error("Error deleting user:", error);
49-
// You might want to show an error toast here
50+
// TODO: Show an error toast here once we start using toasts for showing operation results.
5051
}
5152
};
5253

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export function MemberContainer({
5252
return (
5353
<div className="space-y-6">
5454
<div className="flex justify-between items-center">
55-
<h2 className="text-2xl font-semibold">Members</h2>
5655
{/* Only show the button if user is a coach to _some_ user within the
5756
scope of the organization. We may come back and add this directly to user
5857
data. */}

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Card, CardContent } from "@/components/ui/card";
22
import { User } from "@/types/user";
33
import { MemberCard } from "./member-card";
44
import { CoachingRelationshipWithUserNames } from "@/types/coaching_relationship_with_user_names";
5+
import { Id } from "@/types/general";
56

67
interface MemberListProps {
78
users: User[];
@@ -15,12 +16,12 @@ export function MemberList({
1516
onRefresh,
1617
}: MemberListProps) {
1718
// Create a mapping of user IDs to their associated relationships
18-
const userRelationshipsMap = users.reduce((acc, user) => {
19-
acc[user.id] = relationships.filter(
19+
const userRelationshipsMap = users.reduce((accumulator_map, user) => {
20+
accumulator_map[user.id] = relationships.filter(
2021
(rel) => rel.coach_id === user.id || rel.coachee_id === user.id
2122
);
22-
return acc;
23-
}, {} as Record<string, CoachingRelationshipWithUserNames[]>);
23+
return accumulator_map;
24+
}, {} as Record<Id, CoachingRelationshipWithUserNames[]>);
2425

2526
return (
2627
<Card className="w-full">

src/lib/api/actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const ActionApi = {
7373
* @param actionId The ID of the action to delete
7474
* @returns Promise resolving to the deleted Action object
7575
*/
76-
deleteNested: async (entityId: Id, actionId: Id): Promise<Action> => {
76+
deleteNested: async (_entityId: Id, _actionId: Id): Promise<Action> => {
7777
throw new Error("Delete nested operation not implemented");
7878
},
7979
};

src/lib/api/agreements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const AgreementApi = {
7777
* @param agreementId The ID of the agreement to delete
7878
* @returns Promise resolving to the deleted Agreement object
7979
*/
80-
deleteNested: async (entityId: Id, agreementId: Id): Promise<Agreement> => {
80+
deleteNested: async (_entityId: Id, agreementId: Id): Promise<Agreement> => {
8181
throw new Error("Delete nested operation not implemented");
8282
},
8383
};

src/lib/api/coaching-relationships.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ export const CoachingRelationshipApi = {
100100
* @returns Promise resolving to the deleted CoachingRelationshipWithUserNames object
101101
*/
102102
deleteNested: async (
103-
organizationId: Id,
104-
relationshipId: Id
103+
_organizationId: Id,
104+
_relationshipId: Id
105105
): Promise<CoachingRelationshipWithUserNames> => {
106106
throw new Error("Delete nested operation not implemented");
107107
},

src/lib/api/coaching-sessions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const CoachingSessionApi = {
104104
* @returns Promise resolving to the deleted CoachingSession object
105105
*/
106106
deleteNested: async (
107-
entityId: Id,
107+
_entityId: Id,
108108
coachingSessionId: Id
109109
): Promise<CoachingSession> => {
110110
throw new Error("Delete nested operation not implemented");

src/lib/api/entity-api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ export namespace EntityApi {
193193
url: string,
194194
config?: any
195195
): Promise<R> => {
196-
console.log("deleteFn", url, config);
197196
return mutationFn<T, R>("delete", url, config);
198197
};
199198

0 commit comments

Comments
 (0)