mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-21 21:57:56 +01:00
Add starred get endpoint
This commit is contained in:
parent
6b220ccb81
commit
44bb67936b
@ -462,6 +462,20 @@ public class MindmapController extends BaseController {
|
|||||||
mindmapService.updateCollaboration(user, collaboration.get());
|
mindmapService.updateCollaboration(user, collaboration.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(method = RequestMethod.GET, value = "/maps/{id}/starred", produces = {"text/plain"})
|
||||||
|
@ResponseBody
|
||||||
|
public String fetchStarred(@PathVariable int id) throws WiseMappingException {
|
||||||
|
final Mindmap mindmap = findMindmapById(id);
|
||||||
|
final User user = Utils.getUser();
|
||||||
|
|
||||||
|
final Optional<Collaboration> collaboration = mindmap.findCollaboration(user);
|
||||||
|
if (!collaboration.isPresent()) {
|
||||||
|
throw new WiseMappingException("No enough permissions.");
|
||||||
|
}
|
||||||
|
boolean result = collaboration.get().getCollaborationProperties().getStarred();
|
||||||
|
return Boolean.toString(result);
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping(method = RequestMethod.DELETE, value = "/maps/batch")
|
@RequestMapping(method = RequestMethod.DELETE, value = "/maps/batch")
|
||||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||||
public void batchDelete(@RequestParam() String ids) throws IOException, WiseMappingException {
|
public void batchDelete(@RequestParam() String ids) throws IOException, WiseMappingException {
|
||||||
|
@ -227,7 +227,7 @@ public class RestMindmapITCase {
|
|||||||
Optional<RestMindmapInfo> mindmapInfo = fetchMap(requestHeaders, template, mapId);
|
Optional<RestMindmapInfo> mindmapInfo = fetchMap(requestHeaders, template, mapId);
|
||||||
|
|
||||||
// @todo: Enforce check...
|
// @todo: Enforce check...
|
||||||
// assertTrue(mindmapInfo.get().getStarred() == true);
|
assertTrue(mindmapInfo.get().getStarred() == true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function")
|
@Test(dataProviderClass = RestHelper.class, dataProvider = "ContentType-Provider-Function")
|
||||||
|
Loading…
Reference in New Issue
Block a user