Add link to invoice PDF to frontend
This commit is contained in:
		
							parent
							
								
									f4dc8b24bc
								
							
						
					
					
						commit
						19dea7a061
					
				|  | @ -36,6 +36,7 @@ class InvoiceResource extends JsonResource | ||||||
|             'greeting' => $this->greeting, |             'greeting' => $this->greeting, | ||||||
|             'usage' => $this->usage, |             'usage' => $this->usage, | ||||||
|             'links' => [ |             'links' => [ | ||||||
|  |                 'pdf' => route('invoice.pdf', ['invoice' => $this->getModel()]), | ||||||
|                 'update' => route('invoice.update', ['invoice' => $this->getModel()]), |                 'update' => route('invoice.update', ['invoice' => $this->getModel()]), | ||||||
|                 'destroy' => route('invoice.destroy', ['invoice' => $this->getModel()]), |                 'destroy' => route('invoice.destroy', ['invoice' => $this->getModel()]), | ||||||
|             ] |             ] | ||||||
|  |  | ||||||
|  | @ -94,7 +94,9 @@ | ||||||
|                     <div v-text="invoice.via"></div> |                     <div v-text="invoice.via"></div> | ||||||
|                 </td> |                 </td> | ||||||
|                 <td> |                 <td> | ||||||
|                     <a v-tooltip="`Bearbeiten`" href="#" class="inline-flex btn btn-warning btn-sm" |                     <a v-tooltip="`Anschauen`" :href="invoice.links.pdf" target="_BLANK" | ||||||
|  |                         class="inline-flex btn btn-info btn-sm"><ui-sprite src="eye"></ui-sprite></a> | ||||||
|  |                     <a v-tooltip="`Bearbeiten`" href="#" class="ml-2 inline-flex btn btn-warning btn-sm" | ||||||
|                         @click.prevent="edit(invoice)"><ui-sprite src="pencil"></ui-sprite></a> |                         @click.prevent="edit(invoice)"><ui-sprite src="pencil"></ui-sprite></a> | ||||||
|                     <a v-tooltip="`Löschen`" href="#" class="ml-2 inline-flex btn btn-danger btn-sm" |                     <a v-tooltip="`Löschen`" href="#" class="ml-2 inline-flex btn btn-danger btn-sm" | ||||||
|                         @click.prevent="deleting = invoice"><ui-sprite src="trash"></ui-sprite></a> |                         @click.prevent="deleting = invoice"><ui-sprite src="trash"></ui-sprite></a> | ||||||
|  |  | ||||||
|  | @ -41,6 +41,7 @@ class InvoiceIndexActionTest extends TestCase | ||||||
|             ->assertInertiaPath('data.data.0.positions.0.member_id', $member->id) |             ->assertInertiaPath('data.data.0.positions.0.member_id', $member->id) | ||||||
|             ->assertInertiaPath('data.data.0.positions.0.description', 'lala') |             ->assertInertiaPath('data.data.0.positions.0.description', 'lala') | ||||||
|             ->assertInertiaPath('data.data.0.positions.0.id', $invoice->positions->first()->id) |             ->assertInertiaPath('data.data.0.positions.0.id', $invoice->positions->first()->id) | ||||||
|  |             ->assertInertiaPath('data.data.0.links.pdf', route('invoice.pdf', ['invoice' => $invoice])) | ||||||
|             ->assertInertiaPath('data.data.0.links.update', route('invoice.update', ['invoice' => $invoice])) |             ->assertInertiaPath('data.data.0.links.update', route('invoice.update', ['invoice' => $invoice])) | ||||||
|             ->assertInertiaPath('data.data.0.links.destroy', route('invoice.destroy', ['invoice' => $invoice])) |             ->assertInertiaPath('data.data.0.links.destroy', route('invoice.destroy', ['invoice' => $invoice])) | ||||||
|             ->assertInertiaPath('data.meta.links.mass-store', route('invoice.mass-store')) |             ->assertInertiaPath('data.meta.links.mass-store', route('invoice.mass-store')) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue