BY-186 Cambiar los endpoints de bookmarks que se encuentran en users, para pasar a cases

This commit is contained in:
Dante
2016-02-15 11:44:25 -04:00
parent f781eb6fbc
commit 2d1fa53b88
2 changed files with 38 additions and 38 deletions

View File

@@ -1110,4 +1110,42 @@ class Cases extends Api
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* Mark a task process as a bookmark
* @url POST /bookmark/:tas_uid
*
* @param string $tas_uid {@min 32}{@max 32}
*
*/
public function doPostBookmarkStartCase($tas_uid)
{
try {
$userLoggedUid = $this->getUserId();
$user = new \ProcessMaker\BusinessModel\User();
$user->updateBookmark($userLoggedUid, $tas_uid, 'INSERT');
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* Remove a task process from bookmarks
* @url DELETE /bookmark/:tas_uid
*
* @param string $tas_uid {@min 32}{@max 32}
*
*/
public function doDeleteBookmarkStartCase($tas_uid)
{
try {
$userLoggedUid = $this->getUserId();
$user = new \ProcessMaker\BusinessModel\User();
$user->updateBookmark($userLoggedUid, $tas_uid, 'DELETE');
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
}

View File

@@ -143,43 +143,5 @@ class User extends Api
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* Save Bookmark start case
* @url POST /bookmark/:tas_uid
*
* @param string $tas_uid {@min 32}{@max 32}
*
*/
public function doPostBookmarkStartCase($tas_uid)
{
try {
$userLoggedUid = $this->getUserId();
$user = new \ProcessMaker\BusinessModel\User();
$user->updateBookmark($userLoggedUid, $tas_uid, 'INSERT');
return array('bookmarkedTaskId'=>$tas_uid);
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* Delete Bookmark start case
* @url DELETE /bookmark/:tas_uid
*
* @param string $tas_uid {@min 32}{@max 32}
*
*/
public function doDeleteBookmarkStartCase($tas_uid)
{
try {
$userLoggedUid = $this->getUserId();
$user = new \ProcessMaker\BusinessModel\User();
$user->updateBookmark($userLoggedUid, $tas_uid, 'DELETE');
return array('unbookmarkedTaskId'=>$tas_uid);
} catch (\Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
}