mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-29 09:43:16 +00:00
Update Api Transformers, fixes #2234
This commit is contained in:
parent
344b0c94cd
commit
6300789115
2 changed files with 4 additions and 2 deletions
|
@ -37,10 +37,10 @@ class NotificationTransformer extends Fractal\TransformerAbstract
|
||||||
if($status) {
|
if($status) {
|
||||||
return $this->item($status, new StatusTransformer());
|
return $this->item($status, new StatusTransformer());
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return $this->collection([], new StatusTransformer());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return $this->collection([], new StatusTransformer());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,8 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
||||||
if(in_array($status->type, ['photo', 'video', 'photo:album', 'loop', 'photo:video:album'])) {
|
if(in_array($status->type, ['photo', 'video', 'photo:album', 'loop', 'photo:video:album'])) {
|
||||||
$media = $status->media()->orderBy('order')->get();
|
$media = $status->media()->orderBy('order')->get();
|
||||||
return $this->collection($media, new MediaTransformer());
|
return $this->collection($media, new MediaTransformer());
|
||||||
|
} else {
|
||||||
|
return $this->collection([], new MediaTransformer());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue