updateMyEventList(city) {
    if (this.state.validatedToken) {
      const requestOptions = {
        method: "GET",
        headers: {
          Accept: "application/json",
          "Content-Type": "application/json",
          Authorization: `Token ${this.state.validatedToken}`,
        },
      };
      fetch(
        `${this.state.apiEndpint}/api/v0/event/myrecent/${city}`,
        requestOptions
      )
        .then((response) => response.json())
        .then((json) => {
          let result = [];
          json.forEach((item) => {
            result.push(item.uuid);
          });
          this.setState({ myEvents: result });
          console.log("loaded my events from backend");
        });
    }
  }
// loads a fresh copy of myeventlist, which allows editing of events created by current user
loads a fresh copy of myeventlist, which allows editing of events created by current user
loads a fresh copy of myeventlist which allows editing of events created by current user
updateMyEventList(city) {
    if (this.state.validatedToken) {
      const requestOptions = {
        method: "GET",
        headers: {
          Accept: "application/json",
          "Content-Type": "application/json",
          Authorization: `Token ${this.state.validatedToken}`,
        },
      };
      fetch(
        `${this.state.apiEndpint}/api/v0/event/myrecent/${city}`,
        requestOptions
      )
        .then((response) => response.json())
        .then((json) => {
          let result = [];
          json.forEach((item) => {
            result.push(item.uuid);
          });
          this.setState({ myEvents: result });
          console.log("loaded my events from backend");
        });
    }
  }
updateMyEventList ( city ) { if ( this . state . validatedToken ) { const requestOptions = { method : "GET" , headers : { Accept : "application/json" , "Content-Type" : "application/json" , Authorization : ` ${ this . state . validatedToken } ` , } , } ; fetch ( ` ${ this . state . apiEndpint } ${ city } ` , requestOptions ) . then ( ( response ) => response . json ( ) ) . then ( ( json ) => { let result = [ ] ; json . forEach ( ( item ) => { result . push ( item . uuid ) ; } ) ; this . setState ( { myEvents : result } ) ; console . log ( "loaded my events from backend" ) ; } ) ; } }
loads a fresh copy of myeventlist, which allows editing of events created by current user
loads a fresh copy of myeventlist which allows editing of events created by current user