-
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 'development' into backend
- Loading branch information
Showing
117 changed files
with
6,026 additions
and
1,466 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ name: 'Auto Assign Reviewers' | |
|
||
on: | ||
pull_request: | ||
types: [opened, labeled] | ||
types: [opened] | ||
|
||
jobs: | ||
assign_reviewers: | ||
|
@@ -43,12 +43,13 @@ jobs: | |
with: | ||
script: | | ||
const targetBranch = context.payload.pull_request.base.ref; | ||
const reviewers = targetBranch === 'main' ? 3 : 2; | ||
core.setOutput('number_of_reviewers', reviewers); | ||
const reviewers = (targetBranch === 'main' || targetBranch === 'development') ? 3 : 2; | ||
return { number_of_reviewers: reviewers }; | ||
- name: 'Assign Reviewers' | ||
uses: kentaro-m/[email protected] | ||
with: | ||
repo-token: '${{ secrets.GITHUB_TOKEN }}' | ||
configuration-path: '.github/auto_assign_config.yml' | ||
numberOfReviewers: ${{ steps.determine_reviewers.outputs.number_of_reviewers }} | ||
|
This file was deleted.
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
export const App = () => <div>Hello</div>; | ||
import { IndexRoutes } from '@/routes/IndexRoutes.tsx'; | ||
|
||
export const App = () => <IndexRoutes />; |
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,56 @@ | ||
import { getApiClient } from '@/api/client.api.ts'; | ||
import { ResponseDto } from '@/api/dto/response.dto.ts'; | ||
import { LoginResEntity, RegisterResEntity } from '@/api/dto/auth.dto.ts'; | ||
|
||
export const doLogin = (id: string, password: string): Promise<ResponseDto<LoginResEntity>> => { | ||
const promiseFn = ( | ||
fnResolve: (value: ResponseDto<LoginResEntity>) => void, | ||
fnReject: (reason?: any) => void, | ||
) => { | ||
const apiClient = getApiClient(); | ||
apiClient | ||
.post('/auth/login', { id, password }) | ||
.then(res => { | ||
if (res.status !== 200) { | ||
console.error(res); | ||
fnReject(`msg.${res}`); | ||
} else { | ||
fnResolve(new ResponseDto<LoginResEntity>(res)); | ||
} | ||
}) | ||
.catch(err => { | ||
console.error(err); | ||
fnReject('msg.RESULT_FAILED'); | ||
}); | ||
}; | ||
return new Promise(promiseFn); | ||
}; | ||
|
||
export const doRegister = ( | ||
id: string, | ||
name: string, | ||
password: string, | ||
email: string, | ||
): Promise<ResponseDto<RegisterResEntity>> => { | ||
const promiseFn = ( | ||
fnResolve: (value: ResponseDto<RegisterResEntity>) => void, | ||
fnReject: (reason?: any) => void, | ||
) => { | ||
const apiClient = getApiClient(); | ||
apiClient | ||
.post('/auth/register', { id, name, password, email }) | ||
.then(res => { | ||
if (res.status !== 200) { | ||
console.error(res); | ||
fnReject(`msg.${res}`); | ||
} else { | ||
fnResolve(new ResponseDto<RegisterResEntity>(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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { AppConfig } from '@/constants'; | ||
import { loadLocalData } from '@/utils/common/manageLocalData.ts'; | ||
import axios from 'axios'; | ||
|
||
let apiClient = axios.create({ | ||
baseURL: AppConfig.API_SERVER, | ||
headers: { | ||
'Content-type': 'application/json', | ||
'Access-Control-Allow-Origin': '*', | ||
'Access-Control-Allow-Credentials': true, | ||
}, | ||
}); | ||
|
||
export function setApiToken(token: string): void { | ||
if (apiClient) apiClient.defaults.headers.common.Authorization = `Bearer ${token}`; | ||
} | ||
|
||
export const getApiClient = () => { | ||
const token = loadLocalData(AppConfig.KEYS.LOGIN_TOKEN); | ||
if (token) setApiToken(token); | ||
if (!apiClient) { | ||
apiClient = axios.create({ | ||
baseURL: AppConfig.API_SERVER, | ||
headers: { | ||
'Content-type': 'application/json', | ||
'Access-Control-Allow-Origin': '*', | ||
}, | ||
}); | ||
} | ||
return apiClient; | ||
}; |
Oops, something went wrong.