Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
Easy Quest - Smart Recruitment Tool with AI - Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
22_23 - J 36
Easy Quest - Smart Recruitment Tool with AI - Backend
Commits
01069807
Commit
01069807
authored
May 15, 2023
by
H.M.C. Nadunithara Wijerathne
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'it1924312' into 'master'
close jobs See merge request
!10
parents
ec100f17
8fb90230
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
24 deletions
+40
-24
NodeServer/src/routes/jobs.ts
NodeServer/src/routes/jobs.ts
+40
-24
PythonServer/voices/6435685eba7eda36b0735e74.mp4
PythonServer/voices/6435685eba7eda36b0735e74.mp4
+0
-0
No files found.
NodeServer/src/routes/jobs.ts
View file @
01069807
import
{
Router
}
from
"
express
"
;
import
{
JobType
,
TypedRequest
,
USER_TYPE
,
}
from
"
../config/types
"
;
import
{
authMiddleware
,
organizationMiddleware
,
}
from
"
../middlewares/auth
"
;
import
{
JobType
,
TypedRequest
,
USER_TYPE
}
from
"
../config/types
"
;
import
{
authMiddleware
,
organizationMiddleware
}
from
"
../middlewares/auth
"
;
import
Auth
from
"
../models/Auth
"
;
import
Jobs
from
"
../models/Job
"
;
import
Application
from
"
../models/Application
"
;
const
router
=
Router
();
...
...
@@ -102,23 +96,45 @@ router.delete(
}
);
router
.
get
(
"
/search
"
,
authMiddleware
,
(
req
:
TypedRequest
<
{
key
:
string
},
null
>
,
res
)
=>
{
console
.
log
(
req
.
query
.
key
)
const
pipeline
=
[
{
$search
:
{
index
:
"
searchJobs
"
,
text
:
{
query
:
req
.
query
.
key
,
path
:
{
"
wildcard
"
:
"
*
"
},
fuzzy
:
{},
router
.
get
(
"
/search
"
,
authMiddleware
,
(
req
:
TypedRequest
<
{
key
:
string
},
null
>
,
res
)
=>
{
console
.
log
(
req
.
query
.
key
);
const
pipeline
=
[
{
$search
:
{
index
:
"
searchJobs
"
,
text
:
{
query
:
req
.
query
.
key
,
path
:
"
title
"
,
fuzzy
:
{},
},
},
},
];
Jobs
.
aggregate
(
pipeline
)
.
then
((
data
)
=>
res
.
status
(
200
).
json
({
data
}))
.
catch
(()
=>
{
res
.
status
(
200
).
json
({
data
:
[]
});
});
}
);
router
.
delete
(
"
/close
"
,
authMiddleware
,
async
(
req
:
TypedRequest
<
{},
{
jobId
:
string
}
>
,
res
)
=>
{
try
{
await
Jobs
.
findByIdAndDelete
(
req
.
body
.
jobId
);
await
Application
.
deleteMany
({
job
:
req
.
body
.
jobId
,
});
return
res
.
status
(
200
).
send
(
"
SUCCESS
"
);
}
catch
(
error
:
any
)
{
return
res
.
status
(
400
).
send
(
error
.
message
);
}
];
Jobs
.
aggregate
(
pipeline
).
then
((
data
)
=>
res
.
status
(
200
).
json
({
data
})).
catch
(()
=>
{
res
.
status
(
200
).
json
({
data
:[]
})
});
})
}
);
module
.
exports
=
router
;
PythonServer/voices/6435685eba7eda36b0735e74.mp4
deleted
100644 → 0
View file @
ec100f17
File deleted
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment