From 08b551201fe72e71fd031a22542439d3e1b70169 Mon Sep 17 00:00:00 2001
From: Fulgen301 <tokmajigeorge@gmail.com>
Date: Sun, 16 Sep 2018 16:59:45 +0200
Subject: Initial adapt to LegacyClonk

---
 src/pages/UploadList.vue | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

(limited to 'src/pages/UploadList.vue')

diff --git a/src/pages/UploadList.vue b/src/pages/UploadList.vue
index 733206f..423f381 100644
--- a/src/pages/UploadList.vue
+++ b/src/pages/UploadList.vue
@@ -17,16 +17,16 @@
         :visible-columns="visibleColumns"
         @refresh="refresh">
         <q-td slot='body-cell-title' slot-scope="props" :props='props'>
-          <router-link :to="{name: 'upload-detail', params: {uploadId: props.row._id}}">{{ props.value }}</router-link>
+          <router-link :to="{name: 'upload-detail', params: {uploadId: props.row.id}}">{{ props.value }}</router-link>
         </q-td>
         <q-td slot='body-cell-action' slot-scope="props" :props='props'>
           <q-btn color="primary"
-                 v-if="$route.params.uploadId !== props.row._id"
+                 v-if="$route.params.uploadId !== props.row.id"
                  small
                  outline
                  icon="fa-info-circle"
                  label="Show"
-                 @click="$router.push({name: 'upload-detail', params: {uploadId: props.row._id}})" />
+                 @click="$router.push({name: 'upload-detail', params: {uploadId: props.row.id}})" />
         </q-td>
         <q-td slot='body-cell-voting' slot-scope="props" :props='props'>
           {{ props.value.sum }} <i class="fa" :class="{'fa-caret-up text-positive': props.value.sum > 0, 'fa-caret-down text-negative': props.value.sum < 0, 'fa-sort text-dark': props.value.sum === 0}"></i>
@@ -82,7 +82,7 @@
             align: 'left',
             format: el => typeof el === 'string' && el.length > 50 ? el.slice(0, 50) + '...' : el,
           },
-          {name: 'author', label: 'Author', field: row => row.author.username, align: 'left'},
+          {name: 'author', label: 'Author', field: row => row.author.name, align: 'left'},
           {name: 'voting', label: 'Voting', field: 'voting', align: 'left'},
           {
             name: 'updatedAt',
@@ -99,6 +99,7 @@
       refresh (done) {
         let that = this
         this.$http.get('/uploads').then((response) => {
+          console.log(response.data.uploads)
           that.response = response
           that.uploads = response.data.uploads
           if (done) {
@@ -118,7 +119,7 @@
             outline: true,
           },
           cancel: 'Cancel',
-        }).then(() => that.$http.delete(`/uploads/${upload._id}`).then(response => that.refresh()))
+        }).then(() => that.$http.delete(`/uploads/${upload.id}`).then(response => that.refresh()))
       },
     },
   }
-- 
cgit v1.2.3-54-g00ecf

