-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 앱링크 설정 추가 * report comment기능 수정
- Loading branch information
Showing
5 changed files
with
62 additions
and
15 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
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,36 @@ | ||
import { getAccessToken } from '../../../hooks/asyncStorage/Login'; | ||
import httpClient from '../../BaseHttpClient'; | ||
|
||
export interface reportType { | ||
reportType: 'SPAM' | 'INAPPROPRIATE_CONTENT' | 'ABUSE' | 'IMPERSONATION' | 'OTHERS'; | ||
reason: string; | ||
commentId: number; | ||
} | ||
|
||
export async function reportComment(report: reportType) { | ||
const token = await getAccessToken(); | ||
|
||
try { | ||
const res = await httpClient.post<ReportResponse>( | ||
'https://api-keewe.com/api/v1/report/comment', | ||
report, | ||
{ | ||
headers: { | ||
Authorization: `Bearer ${token}`, | ||
}, | ||
}, | ||
); | ||
|
||
if (res.status !== 200) throw new Error('Report status is not 200'); | ||
|
||
return res.data; | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
} | ||
|
||
export interface ReportResponse { | ||
message: string; | ||
code: number; | ||
data: null; | ||
} |
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