mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Consistent use of links in transformers.
This commit is contained in:
@@ -49,6 +49,12 @@ class AttachmentTransformer extends TransformerAbstract
|
||||
'notes' => $attachment->notes,
|
||||
'mime' => $attachment->mime,
|
||||
'size' => $attachment->size,
|
||||
'links' => [
|
||||
[
|
||||
'rel' => 'self',
|
||||
'uri' => '/attachment/' . $attachment->id,
|
||||
],
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
@@ -72,7 +72,7 @@ class BillTransformer extends TransformerAbstract
|
||||
{
|
||||
$attachments = $bill->attachments()->get();
|
||||
|
||||
return $this->collection($attachments, new AttachmentTransformer);
|
||||
return $this->collection($attachments, new AttachmentTransformer,'attachment');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,7 +84,7 @@ class BillTransformer extends TransformerAbstract
|
||||
{
|
||||
$notes = $bill->notes()->get();
|
||||
|
||||
return $this->collection($notes, new NoteTransformer);
|
||||
return $this->collection($notes, new NoteTransformer,'note');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,7 +114,7 @@ class BillTransformer extends TransformerAbstract
|
||||
'links' => [
|
||||
[
|
||||
'rel' => 'self',
|
||||
'uri' => '/bills/' . $bill->id,
|
||||
'uri' => '/bill/' . $bill->id,
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@@ -48,6 +48,12 @@ class NoteTransformer extends TransformerAbstract
|
||||
'title' => $note->title,
|
||||
'text' => $note->text,
|
||||
'markdown' => $converter->convertToHtml($note->text),
|
||||
'links' => [
|
||||
[
|
||||
'rel' => 'self',
|
||||
'uri' => '/note/' . $note->id,
|
||||
],
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user