mirror of
https://github.com/flarum/core.git
synced 2025-10-17 01:36:09 +02:00
Update for new tobscure/json-api relationship handling
This commit is contained in:
@@ -51,27 +51,27 @@ class NotificationSerializer extends AbstractSerializer
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Flarum\Api\Relationship\HasOneBuilder
|
||||
* @return \Tobscure\JsonApi\Relationship
|
||||
*/
|
||||
protected function user()
|
||||
protected function user($notification)
|
||||
{
|
||||
return $this->hasOne('Flarum\Api\Serializer\UserBasicSerializer');
|
||||
return $this->hasOne($notification, 'Flarum\Api\Serializer\UserBasicSerializer');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Flarum\Api\Relationship\HasOneBuilder
|
||||
* @return \Tobscure\JsonApi\Relationship
|
||||
*/
|
||||
protected function sender()
|
||||
protected function sender($notification)
|
||||
{
|
||||
return $this->hasOne('Flarum\Api\Serializer\UserBasicSerializer');
|
||||
return $this->hasOne($notification, 'Flarum\Api\Serializer\UserBasicSerializer');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Flarum\Api\Relationship\HasOneBuilder
|
||||
* @return \Tobscure\JsonApi\Relationship
|
||||
*/
|
||||
protected function subject()
|
||||
protected function subject($notification)
|
||||
{
|
||||
return $this->hasOne(function ($notification) {
|
||||
return $this->hasOne($notification, function ($notification) {
|
||||
return static::$subjectSerializers[$notification->type];
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user