mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-21 04:11:50 +03:00
updated addReport method to support report type
This commit is contained in:
parent
cd7780113e
commit
73f724746b
@ -124,7 +124,7 @@ class PostDropdownContainer extends PureComponent {
|
||||
const { dispatch, intl } = this.props;
|
||||
|
||||
const _onConfirm = () => {
|
||||
addReport(url)
|
||||
addReport('content', url)
|
||||
.then(() => {
|
||||
dispatch(
|
||||
toastNotification(
|
||||
|
@ -160,12 +160,20 @@ export const deleteBookmark = async (bookmarkId:string) => {
|
||||
}
|
||||
|
||||
|
||||
export const addReport = (url) =>
|
||||
api
|
||||
export const addReport = async (type:'content'|'user', data:string) => {
|
||||
try {
|
||||
const response = await api
|
||||
.post('/report', {
|
||||
url,
|
||||
type,
|
||||
data
|
||||
})
|
||||
.then((resp) => resp.data);
|
||||
return response.data
|
||||
} catch(err){
|
||||
console.warn("Failed to report to ecency")
|
||||
bugsnagInstance.notify(err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user