Hong

.

...@@ -140,8 +140,8 @@ router.post('/makefolder', function(req, res, next) { ...@@ -140,8 +140,8 @@ router.post('/makefolder', function(req, res, next) {
140 console.log('insert error'); 140 console.log('insert error');
141 res.status(400).send({ err: err }); 141 res.status(400).send({ err: err });
142 } else { 142 } else {
143 - let checkfolder = 'SELECT * FROM folders WHERE location = ? AND user_id = ?;'; 143 + let checkfolder = 'SELECT * FROM folders WHERE location = ? AND user_id = ? AND folder_name != ?;';
144 - connection.query(checkfolder, [cur, user_id], function(err, rows, fields) { 144 + connection.query(checkfolder, [cur, user_id, 'trashcan'], function(err, rows, fields) {
145 console.log(rows); 145 console.log(rows);
146 res.status(200).send({ 146 res.status(200).send({
147 folders: rows 147 folders: rows
...@@ -198,8 +198,8 @@ router.post('/delfolder', function(req, res, next) { ...@@ -198,8 +198,8 @@ router.post('/delfolder', function(req, res, next) {
198 console.log("updatesql error"); 198 console.log("updatesql error");
199 res.status(304).send({ error: "updatesql error" }); 199 res.status(304).send({ error: "updatesql error" });
200 } else { 200 } else {
201 - let resultsql = 'SELECT * FROM folders WHERE location = ? AND user_id = ?;'; 201 + let resultsql = 'SELECT * FROM folders WHERE location = ? AND user_id = ? AND folder_name != ?;';
202 - connection.query(resultsql, [cur, user_id], function(err, rows, fields) { 202 + connection.query(resultsql, [cur, user_id, 'trashcan'], function(err, rows, fields) {
203 res.status(200).send({ 203 res.status(200).send({
204 folders: rows 204 folders: rows
205 }); 205 });
...@@ -268,8 +268,8 @@ router.post('/move', function(req, res, next) { ...@@ -268,8 +268,8 @@ router.post('/move', function(req, res, next) {
268 console.log("updatesql error"); 268 console.log("updatesql error");
269 res.status(304).send({ error: "updatesql error" }); 269 res.status(304).send({ error: "updatesql error" });
270 } else { 270 } else {
271 - let resultsql = 'SELECT * FROM folders WHERE location = ? AND user_id = ?;'; 271 + let resultsql = 'SELECT * FROM folders WHERE location = ? AND user_id = ? AND folder_name != ?;';
272 - connection.query(resultsql, [cur, user_id], function(err, rows, fields) { 272 + connection.query(resultsql, [cur, user_id, 'trashcan'], function(err, rows, fields) {
273 res.status(200).send({ 273 res.status(200).send({
274 folders: rows 274 folders: rows
275 }); 275 });
...@@ -317,10 +317,10 @@ router.post('/move', function(req, res, next) { ...@@ -317,10 +317,10 @@ router.post('/move', function(req, res, next) {
317 if (err3) { 317 if (err3) {
318 res.status(304).send({ error: "updatesql error" }); 318 res.status(304).send({ error: "updatesql error" });
319 } else { 319 } else {
320 - let resultsql = 'SELECT * FROM folders WHERE location = ? AND user_id = ?;'; 320 + let resultsql = 'SELECT * FROM files WHERE location = ? AND user_id = ?;';
321 connection.query(resultsql, [cur, user_id], function(err, rows, fields) { 321 connection.query(resultsql, [cur, user_id], function(err, rows, fields) {
322 res.status(200).send({ 322 res.status(200).send({
323 - folders: rows 323 + files: rows
324 }); 324 });
325 }); 325 });
326 } 326 }
...@@ -407,8 +407,8 @@ router.get('/search', function(req, res, next) { ...@@ -407,8 +407,8 @@ router.get('/search', function(req, res, next) {
407 console.log(target); 407 console.log(target);
408 let folders = [] 408 let folders = []
409 let files = [] 409 let files = []
410 - let checkfolder = 'SELECT * FROM folders WHERE folder_name LIKE ' + target + ' AND user_id = ?;'; 410 + let checkfolder = 'SELECT * FROM folders WHERE folder_name LIKE ' + target + ' AND user_id = ? AND folder_name != ?;';
411 - connection.query(checkfolder, [user_id], function(err, folder, fields) { 411 + connection.query(checkfolder, [user_id, 'trashcan'], function(err, folder, fields) {
412 console.log(folder); 412 console.log(folder);
413 folders.push(folder) 413 folders.push(folder)
414 let checkfile = 'SELECT * FROM files WHERE file_name LIKE ' + target + ' AND user_id = ?;'; 414 let checkfile = 'SELECT * FROM files WHERE file_name LIKE ' + target + ' AND user_id = ?;';
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
69 </v-list> 69 </v-list>
70 </v-menu> 70 </v-menu>
71 <v-menu 71 <v-menu
72 - v-model="showMenu" 72 + v-model="showMenuF"
73 :position-x="x" 73 :position-x="x"
74 :position-y="y" 74 :position-y="y"
75 absolute 75 absolute
...@@ -111,6 +111,9 @@ export default { ...@@ -111,6 +111,9 @@ export default {
111 return { 111 return {
112 curfName: {}, 112 curfName: {},
113 showMenu: false, 113 showMenu: false,
114 + search: '',
115 + x: 0,
116 + y: 0,
114 cfilename: {}, 117 cfilename: {},
115 showMenuF: false, 118 showMenuF: false,
116 }; 119 };
...@@ -126,6 +129,7 @@ export default { ...@@ -126,6 +129,7 @@ export default {
126 try { 129 try {
127 const id = this.$store.state.id; 130 const id = this.$store.state.id;
128 const response = await showTrashcan(id); 131 const response = await showTrashcan(id);
132 + console.log(response.data);
129 this.$store.commit('settrashFolderList', response.data.folders); 133 this.$store.commit('settrashFolderList', response.data.folders);
130 this.$store.commit('settrashFileList', response.data.files); 134 this.$store.commit('settrashFileList', response.data.files);
131 } catch (error) { 135 } catch (error) {
......
...@@ -86,7 +86,7 @@ export default new Vuex.Store({ ...@@ -86,7 +86,7 @@ export default new Vuex.Store({
86 return state.trashFolderList; 86 return state.trashFolderList;
87 }, 87 },
88 trashFileL(state) { 88 trashFileL(state) {
89 - return state.trashFolderList; 89 + return state.trashFileList;
90 }, 90 },
91 }, 91 },
92 }); 92 });
...\ No newline at end of file ...\ No newline at end of file
......