import { Alert } from 'react-native';
import { SELF_SURVEY_SERVICES_ACTIVITYID } from '../../Api/ApiUrls';

// instructions
export const getActivityid = async ({ body }) => {
  const url = `${SELF_SURVEY_SERVICES_ACTIVITYID}customer/preInspection`;
  try {
    console.log('URL >>  ', url);
    const res = await fetch(url, {
      headers: {
        'Content-Type': 'application/json',
      },
      method: 'POST',
      body: JSON.stringify(body),
    });

    let data = await res.json();
    if(res.status==412||res.status==400)
    {
      throw new Error(data?.error)
    }
    return data;
  } catch (err) {
    console.log(err);
    throw new Error(err?.message)
  }
};
