From 96b4f44497a9a6f7c07bebd8e7204b370ac36274 Mon Sep 17 00:00:00 2001 From: Sara Salim Date: Fri, 5 Dec 2025 23:25:14 +0200 Subject: [PATCH 1/8] Removed join_message from IJoin --- frontend-next-migration/src/entities/Clan/types/clan.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend-next-migration/src/entities/Clan/types/clan.d.ts b/frontend-next-migration/src/entities/Clan/types/clan.d.ts index ff9992121..260f681bd 100644 --- a/frontend-next-migration/src/entities/Clan/types/clan.d.ts +++ b/frontend-next-migration/src/entities/Clan/types/clan.d.ts @@ -37,11 +37,10 @@ export type ICreateClanResponse = { export type IJoin = { clan_id: string; player_id: string; - join_message: string; }; export type IClanCreateDto = Pick; export type IClanUpdateDto = Pick; -export type IJoinDto = Pick; +export type IJoinDto = Pick; From 04e6b90e0da71470b982713f1c703aad11eda20c Mon Sep 17 00:00:00 2001 From: Sara Salim Date: Thu, 11 Dec 2025 01:11:41 +0200 Subject: [PATCH 2/8] Updated IClan fields, and created IClanRole type --- .../src/entities/Clan/types/clan.d.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/frontend-next-migration/src/entities/Clan/types/clan.d.ts b/frontend-next-migration/src/entities/Clan/types/clan.d.ts index 260f681bd..7be609adc 100644 --- a/frontend-next-migration/src/entities/Clan/types/clan.d.ts +++ b/frontend-next-migration/src/entities/Clan/types/clan.d.ts @@ -16,6 +16,20 @@ export type IClan = { phrase: string; labels: Array[]; positionLeaderboard?: number; + + IClanRole: Array[]; + goal: string; + clanLogo: string; + battlePoints: number; + language: string; + points: number; + ageRange: string; +}; + +export type IClanRole = { + _id: string; + name: string; + clanRoleType: string; }; export type IClanPosition = { @@ -44,3 +58,5 @@ export type IClanCreateDto = Pick; export type IJoinDto = Pick; + +export type IClanRoleDto = Pick; From 17d6be75e21ebfd698677415ea188e430d106a96 Mon Sep 17 00:00:00 2001 From: Sara Salim Date: Thu, 11 Dec 2025 12:37:54 +0200 Subject: [PATCH 3/8] Small fix --- frontend-next-migration/src/entities/Clan/types/clan.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend-next-migration/src/entities/Clan/types/clan.d.ts b/frontend-next-migration/src/entities/Clan/types/clan.d.ts index 7be609adc..b3f17c68a 100644 --- a/frontend-next-migration/src/entities/Clan/types/clan.d.ts +++ b/frontend-next-migration/src/entities/Clan/types/clan.d.ts @@ -17,7 +17,7 @@ export type IClan = { labels: Array[]; positionLeaderboard?: number; - IClanRole: Array[]; + roles: IClanRole[]; goal: string; clanLogo: string; battlePoints: number; From 2beee8f12f067d49be6da7d9585bce211890ff3f Mon Sep 17 00:00:00 2001 From: Sara Salim Date: Thu, 18 Dec 2025 03:59:55 +0200 Subject: [PATCH 4/8] Fixes to IClan interface --- frontend-next-migration/src/entities/Clan/types/clan.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend-next-migration/src/entities/Clan/types/clan.d.ts b/frontend-next-migration/src/entities/Clan/types/clan.d.ts index b3f17c68a..8e7fddad8 100644 --- a/frontend-next-migration/src/entities/Clan/types/clan.d.ts +++ b/frontend-next-migration/src/entities/Clan/types/clan.d.ts @@ -11,10 +11,10 @@ export type IClan = { itemCount: number; tag: string; admin_ids: string[]; - Player: Array[]; + Player: Array[]; // conflict with swagger isOpen: boolean; phrase: string; - labels: Array[]; + labels: Array[]; // conflict with swagger positionLeaderboard?: number; roles: IClanRole[]; @@ -30,6 +30,7 @@ export type IClanRole = { _id: string; name: string; clanRoleType: string; + rights?: Record; }; export type IClanPosition = { From 104d932db51d998646302cd718d15be94a9a816e Mon Sep 17 00:00:00 2001 From: Sara Salim Date: Mon, 22 Dec 2025 01:20:34 +0200 Subject: [PATCH 5/8] Small fixes --- frontend-next-migration/src/entities/Clan/types/clan.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend-next-migration/src/entities/Clan/types/clan.d.ts b/frontend-next-migration/src/entities/Clan/types/clan.d.ts index 8e7fddad8..858ea44c2 100644 --- a/frontend-next-migration/src/entities/Clan/types/clan.d.ts +++ b/frontend-next-migration/src/entities/Clan/types/clan.d.ts @@ -11,10 +11,10 @@ export type IClan = { itemCount: number; tag: string; admin_ids: string[]; - Player: Array[]; // conflict with swagger + Player: Array[]; isOpen: boolean; phrase: string; - labels: Array[]; // conflict with swagger + labels: Array[]; positionLeaderboard?: number; roles: IClanRole[]; From 0000be33142344e62c37e5da4a35516e45cfe3ae Mon Sep 17 00:00:00 2001 From: Skoivumaki Date: Wed, 28 Jan 2026 14:18:48 +0200 Subject: [PATCH 6/8] fix: removed `join_message` which is no longer in types --- .../src/features/JoinClan/model/useJoinClan.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend-next-migration/src/features/JoinClan/model/useJoinClan.ts b/frontend-next-migration/src/features/JoinClan/model/useJoinClan.ts index f7cc33f86..5881f3817 100644 --- a/frontend-next-migration/src/features/JoinClan/model/useJoinClan.ts +++ b/frontend-next-migration/src/features/JoinClan/model/useJoinClan.ts @@ -13,7 +13,7 @@ const useJoinClan = () => { join_message: string, onSuccess?: () => void, ) => { - const result = await joinClan({ clan_id, player_id, join_message }); + const result = await joinClan({ clan_id, player_id }); // @ts-ignore todo figure out ts if (result?.error) { // @ts-ignore todo figure out ts From c9f34ece098a39c63fed2a13d6af107614657619 Mon Sep 17 00:00:00 2001 From: Skoivumaki Date: Wed, 28 Jan 2026 14:30:54 +0200 Subject: [PATCH 7/8] fix: build error --- .../src/features/JoinClan/model/useJoinClan.test.ts | 8 +++----- .../src/features/JoinClan/model/useJoinClan.ts | 7 +------ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/frontend-next-migration/src/features/JoinClan/model/useJoinClan.test.ts b/frontend-next-migration/src/features/JoinClan/model/useJoinClan.test.ts index 6df82f1aa..815aabbe6 100644 --- a/frontend-next-migration/src/features/JoinClan/model/useJoinClan.test.ts +++ b/frontend-next-migration/src/features/JoinClan/model/useJoinClan.test.ts @@ -30,13 +30,12 @@ describe('useJoinClan', () => { const { result } = renderHook(() => useJoinClan()); await act(async () => { - await result.current.handleJoin('clan_id', 'player_id', 'join_message'); + await result.current.handleJoin('clan_id', 'player_id'); }); expect(mockJoinClan).toHaveBeenCalledWith({ clan_id: 'clan_id', player_id: 'player_id', - join_message: 'join_message', }); expect(toast.success).toHaveBeenCalledWith('toast_join_success'); }); @@ -48,13 +47,12 @@ describe('useJoinClan', () => { const { result } = renderHook(() => useJoinClan()); await act(async () => { - await result.current.handleJoin('clan_id', 'player_id', 'join_message'); + await result.current.handleJoin('clan_id', 'player_id'); }); expect(mockJoinClan).toHaveBeenCalledWith({ clan_id: 'clan_id', player_id: 'player_id', - join_message: 'join_message', }); expect(toast.error).toHaveBeenCalledWith(`"${errorMessage}"`); }); @@ -66,7 +64,7 @@ describe('useJoinClan', () => { const { result } = renderHook(() => useJoinClan()); await act(async () => { - await result.current.handleJoin('clan_id', 'player_id', 'join_message', onSuccessMock); + await result.current.handleJoin('clan_id', 'player_id', onSuccessMock); }); expect(onSuccessMock).toHaveBeenCalled(); diff --git a/frontend-next-migration/src/features/JoinClan/model/useJoinClan.ts b/frontend-next-migration/src/features/JoinClan/model/useJoinClan.ts index 5881f3817..d3f2e9905 100644 --- a/frontend-next-migration/src/features/JoinClan/model/useJoinClan.ts +++ b/frontend-next-migration/src/features/JoinClan/model/useJoinClan.ts @@ -7,12 +7,7 @@ const useJoinClan = () => { const [joinClan] = useJoinClanMutation(); // todo good function should not use too much params, think if you could group some or all params to object group(s) - const handleJoin = async ( - clan_id: string, - player_id: string, - join_message: string, - onSuccess?: () => void, - ) => { + const handleJoin = async (clan_id: string, player_id: string, onSuccess?: () => void) => { const result = await joinClan({ clan_id, player_id }); // @ts-ignore todo figure out ts if (result?.error) { From 2e571bcb8d8d6f8b04e85eb1ddb7663ff4dde0ec Mon Sep 17 00:00:00 2001 From: Skoivumaki Date: Wed, 28 Jan 2026 14:35:18 +0200 Subject: [PATCH 8/8] fix: type error --- .../ui/_components/clanoverview/buttonField/ButtonField.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend-next-migration/src/preparedPages/ClanPages/ui/_components/clanoverview/buttonField/ButtonField.tsx b/frontend-next-migration/src/preparedPages/ClanPages/ui/_components/clanoverview/buttonField/ButtonField.tsx index cc1252a85..63738d25b 100644 --- a/frontend-next-migration/src/preparedPages/ClanPages/ui/_components/clanoverview/buttonField/ButtonField.tsx +++ b/frontend-next-migration/src/preparedPages/ClanPages/ui/_components/clanoverview/buttonField/ButtonField.tsx @@ -211,7 +211,7 @@ const ClanInfo = (props: Props) => { className={cls.JoinClanBtn} theme={ButtonTheme.Graffiti} size={ButtonSize.L} - onClick={() => handleJoin(clanData._id, playerId ?? '', 'join')} + onClick={() => handleJoin(clanData._id, playerId ?? '')} > {joinClanBtn}