]> _ Git - psq.git/commitdiff
update longer links
authorLouis Jeckel <louis.jeckel@outlook.cm>
Mon, 21 Sep 2020 08:34:27 +0000 (10:34 +0200)
committerLouis Jeckel <louis.jeckel@outlook.cm>
Mon, 21 Sep 2020 08:34:27 +0000 (10:34 +0200)
app/Events/FileProcessingUpdate.php
app/Http/Controllers/Admin/PublishController.php
app/test [new file with mode: 0644]
resources/js/components/Publish/Step1UploadFile.vue

index 93e8397c2f36cadb89a13290354105e0763edba4..7cc2d03c00770135a68cc9f6d9cf217f2a52be4f 100644 (file)
@@ -28,7 +28,7 @@ class FileProcessingUpdate implements ShouldBroadcast
         $this->file = $file;
         $this->data = [
             'status' => $status,
-            'data' => array_merge(['file_id' => $file->id], $data)
+            'data' => ['file_id' => $file->id]
         ];
     }
 
index 0e8e311f355ce28cd038e5737173ba9bd5a65a79..6b6db3c3c8dcd6f8ea296bcba3d3c1313bf1a9f3 100644 (file)
@@ -54,7 +54,10 @@ class PublishController extends Controller
 
     public function file(Request $request, PdfFile $file)
     {
-        return response()->json($file);
+        return response()->json([
+            'file' => $file,
+            'links' => $file->trackedLinks()->pluck('title')
+        ]);
     }
 
 
diff --git a/app/test b/app/test
new file mode 100644 (file)
index 0000000..0033031
--- /dev/null
+++ b/app/test
@@ -0,0 +1,13 @@
+[{
+"content": "Le Président Américain devrait très prochainement autoriser plusieurs Etats à importer des médicaments depuis le Canada. Et parmi eux, la Floride n'est pas prioritaire par hasard ", "headline":
+"TRUMP ET LES LABOS : \"U.S. DRUGS FROM CANADA\" !\""}, {
+"content": "", "headline":
+"LES USA RECRUTENT À LA TV POUR LES ESSAIS CLINIQUES D'UN VACCIN DONT LA DEUXIÈME ADJOINTE À MARSEILLE AFFIRME \"MOI, JE LE FAIS PAS\" ! "}, {
+"content": "", "headline":
+"AGENCES DE COM SANTÉ : SUDLER, C'EST TERMINÉ "}, {
+"content": "", "headline":
+"BIOGEN ENCORE PLOMBÉ PAR LA JUSTICE SUR SON TECFIDERA - DES ANNONCES \"DIFFICILES\" SONT ATTENDUES"}, {
+"content": "", "headline":
+"POURQUOI J&J S'EST OFFERT MOMENTA"}, {
+"content": "", "headline":
+"VISITE GUIDÉE ET EN IMAGE SUR LES SITES SANOFI"}]
index 90ae82ac0d0c5fafa5cf219d17e5487460dbde47..bdb08b1613870976ab987a1bf2c5d91b1350c9ed 100644 (file)
                 if(e.status === 'done'){
                     this.progressMode = 'determinate';
 
-                    this.links = e.data.links;
-
                     axios.get('/publish/file/'+e.data.file_id).then(data => {
 
-                        this.$root.publishState.file = data.data;
+                        this.$root.publishState.file = data.data.file;
+                        this.links = data.data.links;
+
                         this.status = 'done';
                         this.$emit('can-continue', {value: true});
                     })