mirror of https://github.com/xfarrow/blink
update
This commit is contained in:
parent
7ef8cd4a48
commit
61f021db3c
|
@ -31,7 +31,7 @@ async function insert(requester, organizationId, title, description, requirement
|
||||||
.returning('*');
|
.returning('*');
|
||||||
|
|
||||||
// Insert in the JobOfferTag table all the relevant tags.
|
// Insert in the JobOfferTag table all the relevant tags.
|
||||||
if (tags.length !== 0) {
|
if (tags) {
|
||||||
await Promise.all(tags.map(tag =>
|
await Promise.all(tags.map(tag =>
|
||||||
tr('JobOfferTag').insert({
|
tr('JobOfferTag').insert({
|
||||||
job_offer_id: jobOffer[0].id,
|
job_offer_id: jobOffer[0].id,
|
||||||
|
|
|
@ -14,6 +14,9 @@
|
||||||
const knex = require('../utils/knex_config');
|
const knex = require('../utils/knex_config');
|
||||||
|
|
||||||
async function findByTags(tags) {
|
async function findByTags(tags) {
|
||||||
|
if(!tags){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
tags = tags.map(tag => tag.toLowerCase());
|
tags = tags.map(tag => tag.toLowerCase());
|
||||||
const result = await knex('Tag')
|
const result = await knex('Tag')
|
||||||
.whereIn('tag', tags)
|
.whereIn('tag', tags)
|
||||||
|
|
Loading…
Reference in New Issue