removeEvent(rawdata, eventId) {
    const requestOptions = {
      method: "PATCH",
      headers: {
        Accept: "application/json",
        "Content-Type": "application/json",
        Authorization: `Token ${this.state.validatedToken}`,
      },
      body: JSON.stringify({
        visible: false,
      }),
    };
    fetch(
      `${this.state.apiEndpint}/api/v0/event/edit/${eventId}`,
      requestOptions
    )
      .then((response) => {
        if (!response.ok) {
          throw response;
        }
        return response.json();
      })
      .then((json) => {})
      .catch((response) => console.log(response));
    let cleanedData = [];
    rawdata.forEach((item) => {
      if (item.uuid === eventId) {
      } else {
        cleanedData.push(item);
      }
    });
    return cleanedData;
  }
// the webcall to server to remove event
the webcall to server to remove event
the webcall to server to remove event
removeEvent(rawdata, eventId) {
    const requestOptions = {
      method: "PATCH",
      headers: {
        Accept: "application/json",
        "Content-Type": "application/json",
        Authorization: `Token ${this.state.validatedToken}`,
      },
      body: JSON.stringify({
        visible: false,
      }),
    };
    fetch(
      `${this.state.apiEndpint}/api/v0/event/edit/${eventId}`,
      requestOptions
    )
      .then((response) => {
        if (!response.ok) {
          throw response;
        }
        return response.json();
      })
      .then((json) => {})
      .catch((response) => console.log(response));
    let cleanedData = [];
    rawdata.forEach((item) => {
      if (item.uuid === eventId) {
      } else {
        cleanedData.push(item);
      }
    });
    return cleanedData;
  }
removeEvent ( rawdata , eventId ) { const requestOptions = { method : "PATCH" , headers : { Accept : "application/json" , "Content-Type" : "application/json" , Authorization : ` ${ this . state . validatedToken } ` , } , body : JSON . stringify ( { visible : false , } ) , } ; fetch ( ` ${ this . state . apiEndpint } ${ eventId } ` , requestOptions ) . then ( ( response ) => { if ( ! response . ok ) { throw response ; } return response . json ( ) ; } ) . then ( ( json ) => { } ) . catch ( ( response ) => console . log ( response ) ) ; let cleanedData = [ ] ; rawdata . forEach ( ( item ) => { if ( item . uuid === eventId ) { } else { cleanedData . push ( item ) ; } } ) ; return cleanedData ; }
the webcall to server to remove event
the webcall to server to remove event