Commit 9581b875 authored by Irina Oleynik's avatar Irina Oleynik

Назначение пользователя на должность

(cherry picked from commit e0e757b5)
parent 5109b1ca
var result = true;
var message = 'ok';
try {
let currentFormData = API.getFormData(dataUUID);
let user = UTILS.getValue(currentFormData, "entity_user");
let position = UTILS.getValue(currentFormData, "entity-position");
if(!user || !user.hasOwnProperty('key')) throw new Error('Не выбран пользователь для назначения');
if(!position || !position.hasOwnProperty('key')) throw new Error('Не выбрана должность для назначения');
let res = API.httpGetMethod('rest/api/positions/appoint?userID=' + user.key + "&positionID=" + position.key);
if(res.errorCode != '0') throw new Error(res.errorMessage);
message = res.errorMessage;
} catch (err) {
result = false;
message = err.message;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment