Merge branch 'top-level-links'
This commit is contained in:
commit
d7e7c7447c
11
t/example.t
11
t/example.t
@ -58,6 +58,14 @@ $registry->add_type(
|
|||||||
count => $xtra->{count},
|
count => $xtra->{count},
|
||||||
total => 0+ @$data,
|
total => 0+ @$data,
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
top_level_links => {
|
||||||
|
self => '/articles',
|
||||||
|
},
|
||||||
|
links => {
|
||||||
|
self => sub($data,@) {
|
||||||
|
return "/articles/" . $data->{id};
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -72,6 +80,9 @@ like $output => {
|
|||||||
"count"=> 2,
|
"count"=> 2,
|
||||||
"total"=> 1
|
"total"=> 1
|
||||||
},
|
},
|
||||||
|
"links"=> {
|
||||||
|
"self"=> "/articles"
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
done_testing();
|
done_testing();
|
||||||
|
@ -11,6 +11,7 @@ $registry->add_type(
|
|||||||
id => 'id',
|
id => 'id',
|
||||||
links => {
|
links => {
|
||||||
self => sub ( $data, @ ) {
|
self => sub ( $data, @ ) {
|
||||||
|
no warnings qw/ uninitialized /;
|
||||||
return "/peoples/$data->{id}";
|
return "/peoples/$data->{id}";
|
||||||
}
|
}
|
||||||
} } );
|
} } );
|
||||||
|
Loading…
Reference in New Issue
Block a user