Browse Source

modify test celery file

tomoya 2 years ago
parent
commit
a1eb68e2de

+ 1 - 1
frontend/README.md

@@ -1,4 +1,4 @@
-# frontvue
+# frontend
 
 
 This template should help get you started developing with Vue 3 in Vite.
 This template should help get you started developing with Vue 3 in Vite.
 
 

+ 2 - 3
frontend/src/api.ts

@@ -2,11 +2,10 @@ import axios from "axios";
 import { apiUrl } from "@/env";
 import { apiUrl } from "@/env";
 import type { IUserProfile, IUserProfileUpdate, IUserProfileCreate, IUserProfileRegister } from "@/interfaces";
 import type { IUserProfile, IUserProfileUpdate, IUserProfileCreate, IUserProfileRegister } from "@/interfaces";
 
 
-function authHeaders(token: string, contentType:string="application/json") {
+function authHeaders(token: string) {
   return {
   return {
     headers: {
     headers: {
       Authorization: `Bearer ${token}`,
       Authorization: `Bearer ${token}`,
-      "Content-Type": contentType,
     },
     },
   };
   };
 }
 }
@@ -56,6 +55,6 @@ export const api = {
   async testCeleryFile(token: string, file: File){
   async testCeleryFile(token: string, file: File){
     const formData = new FormData();
     const formData = new FormData();
     formData.append("file", file)
     formData.append("file", file)
-    return axios.post<{msg:string}>(`${apiUrl}/api/v1/utils/test-celery/file`, formData, authHeaders(token, "maltipart/form-data"));
+    return axios.post<{msg:string}>(`${apiUrl}/api/v1/utils/test-celery/file`, formData, authHeaders(token));
   },
   },
 };
 };

+ 1 - 1
frontend/src/stores/admin.ts

@@ -105,7 +105,7 @@ export const useAdminStore = defineStore("AdminStoreId", {
             await mainStore.checkApiError(error);
             await mainStore.checkApiError(error);
           }
           }
         },
         },
-        async actionTestCeleryFile(payload: {file: File}) {
+        async actionTestCeleryFile(payload: File) {
           const mainStore = useMainStore();
           const mainStore = useMainStore();
           try {
           try {
             const loadingNotification = { content: "sending", showProgress: true };
             const loadingNotification = { content: "sending", showProgress: true };

+ 7 - 2
frontend/src/views/main/admin/TestCelery.vue

@@ -6,7 +6,12 @@
       </v-card-title>
       </v-card-title>
       <v-card-text>
       <v-card-text>
           <v-form v-model="validMsg" ref="msgForm">
           <v-form v-model="validMsg" ref="msgForm">
-            <v-text-field @keyup.enter="msgSubmit" label="Message" v-model="msg" :rules="required" ></v-text-field>
+            <v-text-field 
+              @keyup.enter="msgSubmit" 
+              label="Message" v-model="msg" 
+              :rules="required"
+              prepend-icon="message">
+            </v-text-field>
           </v-form>
           </v-form>
       </v-card-text>
       </v-card-text>
       <v-card-actions>
       <v-card-actions>
@@ -24,7 +29,7 @@
           <v-form v-model="validFile" ref="fileForm">
           <v-form v-model="validFile" ref="fileForm">
             <v-file-input
             <v-file-input
               v-model="zipFiles"
               v-model="zipFiles"
-              :rules="[v=>!v]"
+              :rules="[v=> v.length || 'select zip file.']"
               accept=".zip"
               accept=".zip"
               label="File input"
               label="File input"
               prepend-icon="folder_zip"
               prepend-icon="folder_zip"