Explorar o código

delete & restore方法指定async

dygapp %!s(int64=6) %!d(string=hai) anos
pai
achega
f9d675cb9c
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      app/service/news.js

+ 4 - 4
app/service/news.js

@@ -78,12 +78,12 @@ class NewsService extends CrudService {
     return await doc.save();
   }
 
-  delete({ id }) {
-    return this.status({ id, state: 1 });
+  async delete({ id }) {
+    return await this.status({ id, state: 1 });
   }
 
-  restore({ id }) {
-    return this.status({ id, state: 0 });
+  async restore({ id }) {
+    return await this.status({ id, state: 0 });
   }
 }