mirror of https://github.com/xfarrow/blink
removed isHiring from Organization. Will be calculated
This commit is contained in:
parent
61f021db3c
commit
8636416003
|
@ -47,6 +47,11 @@ async function insert(requester, organizationId, title, description, requirement
|
|||
|
||||
async function remove(requester, jobOfferId) {
|
||||
const jobOffer = await findById(jobOfferId);
|
||||
|
||||
if(!jobOffer){
|
||||
return false;
|
||||
}
|
||||
|
||||
const isAdmin = await OrganizationAdmin.isAdmin(requester, jobOffer.organization_id);
|
||||
if (isAdmin) {
|
||||
const deletedRows = await knex('JobOffer')
|
||||
|
|
|
@ -21,12 +21,11 @@ const knex = require('../utils/knex_config');
|
|||
* @param {*} isHiring
|
||||
* @returns
|
||||
*/
|
||||
function createOrganization(name, location, description, isHiring) {
|
||||
function createOrganization(name, location, description) {
|
||||
const organization = {
|
||||
name: name,
|
||||
location: location,
|
||||
description: description,
|
||||
is_hiring: isHiring
|
||||
description: description
|
||||
};
|
||||
return organization;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ async function createOrganization(req, res) {
|
|||
errors: errors.array()
|
||||
});
|
||||
}
|
||||
const organization = Organization.createOrganization(req.body.name, req.body.location, req.body.description, req.body.is_hiring);
|
||||
const organization = Organization.createOrganization(req.body.name, req.body.location, req.body.description);
|
||||
const insertedOrganization = await Organization.insert(organization, req.jwt.person_id);
|
||||
res.set('Location', `/api/organizations/${insertedOrganization.id}`);
|
||||
return res.status(201).json(insertedOrganization);
|
||||
|
|
|
@ -7,8 +7,7 @@ CREATE TABLE IF NOT EXISTS public."Organization"
|
|||
id SERIAL PRIMARY KEY,
|
||||
name character varying(128) NOT NULL,
|
||||
location character varying,
|
||||
description text,
|
||||
is_hiring boolean
|
||||
description text
|
||||
)
|
||||
|
||||
TABLESPACE pg_default;
|
||||
|
|
Loading…
Reference in New Issue