add example for top links
This commit is contained in:
parent
7a9e68a108
commit
6debdda412
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();
|
||||||
|
Loading…
Reference in New Issue
Block a user