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
1af53b9f
Commit
1af53b9f
authored
May 15, 2023
by
H.M.C. Nadunithara Wijerathne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
close job
parent
19d12043
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
24 deletions
+40
-24
NodeServer/src/routes/jobs.ts
NodeServer/src/routes/jobs.ts
+40
-24
PythonServer/voices/6460fe89721e683bdc57ce47.mp4
PythonServer/voices/6460fe89721e683bdc57ce47.mp4
+0
-0
PythonServer/voices/6461cfa1a1fbd82c7c196408.mp4
PythonServer/voices/6461cfa1a1fbd82c7c196408.mp4
+0
-0
No files found.
NodeServer/src/routes/jobs.ts
View file @
1af53b9f
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/6460fe89721e683bdc57ce47.mp4
0 → 100644
View file @
1af53b9f
File added
PythonServer/voices/64
35685eba7eda36b0735e74
.mp4
→
PythonServer/voices/64
61cfa1a1fbd82c7c196408
.mp4
View file @
1af53b9f
File moved
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