mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-05-06 14:46:20 -04:00
* Flag Id Modal created. * Flag item modal radio buttons, styling, cancel button * Flag Item Modal, Api Flags file created * Added id field in Identifications realm schema, Flag Item Modal API call * Clear form, toggle function, click title not just checkbox to toggle * Fixed android checkbox toggle. * Clean up. Flag ID ObsDetail. Closes #301. * Flag realm model, flagged status shown on initial load * Refresh observation after item flagged. In Progress. * Remove console logs, add onError * save button loading spinner * Realm 31 migration for obsservation updated_at * Flags test file * FlagItemModal tests * FlagItemModal tests --------- Co-authored-by: Amanda Bullington <albullington@gmail.com>
24 lines
406 B
JavaScript
24 lines
406 B
JavaScript
// @flow
|
|
|
|
import inatjs from "inaturalistjs";
|
|
|
|
import handleError from "./error";
|
|
|
|
const PARAMS = {
|
|
fields: "all"
|
|
};
|
|
|
|
const createFlag = async (
|
|
params: Object = {},
|
|
opts: Object = {}
|
|
): Promise<any> => {
|
|
try {
|
|
const { results } = await inatjs.flags.create( { ...PARAMS, ...params }, opts );
|
|
return results;
|
|
} catch ( e ) {
|
|
return handleError( e );
|
|
}
|
|
};
|
|
|
|
export default createFlag;
|