/**
* Created by cklimkowsky on 2/27/15.
*/
angular
.module('coopEval')
.service('administrationService', administrationService);
function administrationService($http) {
var urlBase = 'services/UserService';
this.getAdmins = function () {
return $http.get(urlBase + '/getAdminUsers')
};
this.addAdmin = function (adminUser) {
return $http.put(urlBase + '/addAdminUser', adminUser)
};
this.removeAdminUser = function (adminId) {
return $http.delete(urlBase + '/deleteAdminUser?adminId=' + adminId)
};
this.getDeptUsers = function (departmentId) {
return $http.get(urlBase + '/getDepartmentUsers?departmentId=' + departmentId)
};
this.addDeptUser = function (departmentId, deptUser) {
return $http.post(urlBase + '/addDepartmentUser?departmentId='+ departmentId, deptUser)
};
this.removeDeptUser = function (departmentId, deptUserId) {
return $http.delete(urlBase + '/deleteDepartmentUser?departmentId='+ departmentId + '&deptUserID=' + deptUserId)
};
this.getColleges = function () {
return $http.get('services/CollegeService/getAllColleges')
};
this.getDepartments = function (collegeId) {
return $http.get('services/CollegeService/getAllDepartments?collegeId=' + collegeId)
};
this.addCollege = function (college) {
return $http.put('services/CollegeService/addCollege', college)
};
this.removeCollege = function (id) {
return $http.delete('services/CollegeService/deleteCollege?collegeId=' + id)
};
this.addDepartment = function (department) {
return $http.put('services/CollegeService/addDepartment', department)
};
this.removeDepartment = function (id) {
return $http.delete('services/CollegeService/deleteDepartment?departmentId=' + id)
};
this.getStudentForms = function () {
console.log('HERE');
return $http.get('services/FormService/getStudentForms');
};
this.getEmployerForms = function () {
console.log('HERE');
return $http.get('services/FormService/getEmployerForms');
};
this.getForm = function (formName) {
var encodedFormName = formName.replace(' ', '%20');
return $http.get('services/FormService/getForm?name=' + encodedFormName)
};
this.getEmptyQuestionGroup = function () {
return $http.get('services/FormService/getEmptyFormQuestionGroup')
};
this.getEmptyQuestion = function () {
return $http.get('services/FormService/getEmptyFormQuestion')
};
this.addQuestionGroup = function (questionGroup) {
return $http.put('services/FormService/addFormQuestionGroup', questionGroup)
};
this.addQuestion = function (question) {
return $http.put('services/FormService/addFormQuestion', question)
};
this.deleteQuestionGroup = function (questionGroupOrder) {
return $http.delete('services/FormService/deleteFormQuestionGroup?questionGroupOrder=' + questionGroupOrder)
};
this.deleteQuestion = function (questionOrder) {
return $http.delete('services/FormService/deleteFormQuestion?questionOrder=' + questionOrder)
};
this.saveForm = function (form) {
console.log(form);
return $http.put('services/FormService/saveForm', form)
};
this.getAllQuestionCategories = function () {
return $http.get('services/FormService/getAllQuestionCategories')
};
this.getAllQuestionTypes = function () {
return $http.get('services/FormService/getAllQuestionTypes')
};
this.createForm = function (form) {
return $http.put('services/FormService/createForm', form)
};
this.deleteForm = function (formId) {
return $http.delete('services/FormService/deleteForm?formId=' + formId)
};
this.assignForm = function (form) {
return $http.put('services/FormService/assignForm', form)
};
this.getFutureTerms = function () {
return $http.get('services/CollegeService/getFutureTerms')
};
}
|