-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'frontend' into feature/fe/#224-combine-map-and-canvas
- Loading branch information
Showing
22 changed files
with
579 additions
and
134 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { ResponseDto } from '@/api/dto/response.dto.ts'; | ||
import { | ||
createChannelReqEntity, | ||
createChannelResEntity, | ||
getUserChannelsResEntity, | ||
} from '@/api/dto/channel.dto.ts'; | ||
import { getApiClient } from '@/api/client.api.ts'; | ||
|
||
export const createChannel = ( | ||
data: createChannelReqEntity, | ||
): Promise<ResponseDto<createChannelResEntity>> => { | ||
const promiseFn = ( | ||
fnResolve: (value: ResponseDto<createChannelResEntity>) => void, | ||
fnReject: (reason?: any) => void, | ||
) => { | ||
const apiClient = getApiClient(); | ||
apiClient | ||
.post('/channel', data) | ||
.then(res => { | ||
if (res.status !== 200) { | ||
console.error(res); | ||
fnReject(`msg.${res}`); | ||
} else { | ||
fnResolve(new ResponseDto<createChannelResEntity>(res)); | ||
} | ||
}) | ||
.catch(err => { | ||
console.error(err); | ||
fnReject('msg.RESULT_FAILED'); | ||
}); | ||
}; | ||
return new Promise(promiseFn); | ||
}; | ||
|
||
export const getUserChannels = (userId: string): Promise<ResponseDto<getUserChannelsResEntity>> => { | ||
const promiseFn = ( | ||
fnResolve: (value: ResponseDto<getUserChannelsResEntity>) => void, | ||
fnReject: (reason?: any) => void, | ||
) => { | ||
const apiClient = getApiClient(); | ||
apiClient | ||
.get(`/channel/user/${userId}`) | ||
.then(res => { | ||
if (res.status !== 200) { | ||
console.error(res); | ||
fnReject(`msg.${res}`); | ||
} else { | ||
fnResolve(new ResponseDto<getUserChannelsResEntity>(res)); | ||
} | ||
}) | ||
.catch(err => { | ||
console.error(err); | ||
fnReject('msg.RESULT_FAILED'); | ||
}); | ||
}; | ||
return new Promise(promiseFn); | ||
}; |
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,59 @@ | ||
export class locationEntity { | ||
lat: number | undefined; | ||
|
||
lng: number | undefined; | ||
} | ||
|
||
export class guestMarkerStyleEntity { | ||
color: string | undefined; | ||
} | ||
|
||
export class guestEntity { | ||
name: string | undefined; | ||
|
||
start_location: locationEntity | undefined; | ||
|
||
end_location: locationEntity | undefined; | ||
|
||
path: locationEntity[] | undefined; | ||
|
||
marker_style: guestMarkerStyleEntity | undefined; | ||
} | ||
|
||
export class createChannelReqEntity { | ||
name: string | undefined; | ||
|
||
host_id: string | undefined; | ||
|
||
guests: guestEntity[] | undefined; | ||
} | ||
|
||
export class guestSimpleEntity { | ||
id: string | undefined; | ||
|
||
name: string | undefined; | ||
} | ||
|
||
export class createChannelResEntity { | ||
id: string | undefined; | ||
|
||
name: string | undefined; | ||
|
||
host_id: string | undefined; | ||
|
||
guests: guestSimpleEntity[] | undefined; | ||
|
||
created_at: string | undefined; | ||
} | ||
|
||
export class channelListEntity { | ||
id: string | undefined; | ||
|
||
name: string | undefined; | ||
|
||
generated_at: string | undefined; | ||
} | ||
|
||
export class getUserChannelsResEntity { | ||
channels: channelListEntity[] | undefined; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export const HEADER_TITLE: Record<string, string> = { | ||
'/add-channel/:user/draw': '์ ๋ฐ๋ฅธ ๊ฒฝ๋ก ์ค์ ', | ||
}; | ||
|
||
export const HEADER_SUBTITLE: Record<string, string> = { | ||
'/add-channel/:user/draw': '์ฌ์ฉ์ ๋ณ๋ก ์ถ๋ฐ์ง/๋์ฐฉ์ง(๋ง์ปค), ๊ฒฝ๋ก(๊ทธ๋ฆผ)์ ์ค์ ํ ์ ์์ต๋๋ค', | ||
}; | ||
|
||
export const HEADER_LEFTBUTTON: Record<string, string> = { | ||
'/add-channel': 'back', | ||
'/add-channel/:user': 'back', | ||
'/add-channel/:user/draw': 'back', | ||
'/channel/:channelId/host': 'back', | ||
'/register': 'back', | ||
}; | ||
|
||
export const HEADER_RIGHTBUTTON: Record<string, string> = { | ||
'/channel/:channelId/host': 'dropdown', | ||
}; |
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.