-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
623 additions
and
201 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { authInstance } from './instance'; | ||
|
||
export async function deleteShareGroup(shareGroupId: number): Promise<void> { | ||
try { | ||
await authInstance().delete(`/shareGroups/${shareGroupId}`); | ||
} catch (error) { | ||
console.error('Error deleting share group:', error); | ||
throw error; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { authInstance } from './instance'; | ||
|
||
interface IInviteCode { | ||
inviteCode: string; | ||
inviteUrl: string; | ||
} | ||
|
||
export async function getMyInviteCode({ | ||
shareGroupId, | ||
}: { | ||
shareGroupId: number; | ||
}): Promise<IInviteCode> { | ||
try { | ||
const response = await authInstance().get( | ||
`/shareGroups/${shareGroupId}/invite`, | ||
); | ||
if (response.status === 200) { | ||
return { | ||
inviteCode: response.data.inviteCode, | ||
inviteUrl: response.data.inviteUrl, | ||
}; | ||
} else { | ||
throw new Error('Failed to fetch invite code'); | ||
} | ||
} catch (error) { | ||
console.error('Error fetching invite code:', error); | ||
throw error; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { ApiResponse } from 'recoil/types/notice'; | ||
import { authInstance } from './instance'; | ||
|
||
interface IShareGroupInfo { | ||
shareGroupId: number; | ||
name: string; | ||
image: string; | ||
memberCount: number; | ||
inviteUrl: string; | ||
createdAt: string; | ||
} | ||
|
||
interface profile { | ||
profileId: number; // 프로필 id | ||
name: string; // 프로필 이름 | ||
image: string; // URL 형식 | ||
memberId: number; // 해당 프로필로 참여한 회원의 id. 생략할지 고민중 | ||
} | ||
|
||
interface IShareGroupMember { | ||
shareGroupId: number; | ||
name: string; | ||
image: string; | ||
memberCount: number; | ||
inviteUrl: string; | ||
createdAt: string; | ||
profileInfoList: profile[]; | ||
} | ||
|
||
// eslint-disable-next-line prettier/prettier | ||
export async function getMyShareGroup(): Promise<IShareGroupInfo[]> { | ||
try { | ||
const response = await authInstance().get('/shareGroups/my'); | ||
if (response.status === 200) { | ||
return response.data.data.shareGroupInfoList; | ||
} else { | ||
throw new Error('Failed to fetch share group'); | ||
} | ||
} catch (error) { | ||
console.error('Error fetching share group:', error); | ||
throw error; | ||
} | ||
} | ||
|
||
export async function getShareGroupMembers( | ||
shareGroupId: number, | ||
): Promise<IShareGroupMember> { | ||
try { | ||
const response = await authInstance().get(`/shareGroups/${shareGroupId}`); | ||
if (response.status === 200) { | ||
return response.data.data; | ||
} else { | ||
throw new Error('Failed to fetch share group members'); | ||
} | ||
} catch (error) { | ||
console.error('Error fetching share group members:', error); | ||
throw error; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.