mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-30 09:07:28 +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 { dispatch, intl } = this.props;
|
||||||
|
|
||||||
const _onConfirm = () => {
|
const _onConfirm = () => {
|
||||||
addReport(url)
|
addReport('content', url)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
dispatch(
|
dispatch(
|
||||||
toastNotification(
|
toastNotification(
|
||||||
|
@ -160,12 +160,20 @@ export const deleteBookmark = async (bookmarkId:string) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export const addReport = (url) =>
|
export const addReport = async (type:'content'|'user', data:string) => {
|
||||||
api
|
try {
|
||||||
|
const response = await api
|
||||||
.post('/report', {
|
.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