<template>
   <div>
     <v-container justify="center">
      <v-banner><h4>Vos demandes</h4></v-banner>
        <v-container align="center">
          <v-layout row>
            <v-flex  
              v-for="item in requests"
              :key="item.request_id"
            >
            <ImpressionRequest
                :id="item.request_id"
              />
            </v-flex>
          </v-layout>
        </v-container>
     </v-container>
   </div>
</template>

<script>
// 'id', 'stl', 'admin', 'title', 'description', 'status', 'project', 'fullname', 'gcode', 'queue', 'recup_id'
import ImpressionRequest from '@/components/ImpressionRequestCard'
export default {
  mounted() {
    // executed when the user requests this page
    this.load()
  },
  computed: {
    requests () {
      return this.$store.state.my_request_dict
    }
  },
  beforeDestroy () {
    this.no_load = true
  },
  computed: {
    requests () {
      return this.$store.state.my_request_dict
    }
  },
  methods: {
    load () {
      if(this.no_load)
        return
      this.$store.dispatch('update_my_requests', this.filters)
      setTimeout(this.load, 4000);
    }
  },
  data () {
    return {
        no_load: false
    }
  },
  components: {
    ImpressionRequest,
  }
}
</script>
