-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from iam-abin/dev
Dev
- Loading branch information
Showing
66 changed files
with
1,085 additions
and
505 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Request, Response } from 'express'; | ||
import { IDependency } from '../../frameworks/types/dependency'; | ||
|
||
export = (dependencies: IDependency) => { | ||
const { | ||
useCases: { searchRecruitersUseCase }, | ||
} = dependencies; | ||
|
||
return async (req: Request, res: Response) => { | ||
const { searchKey } = req.query; | ||
const { recruiters, numberOfPages } = await searchRecruitersUseCase(dependencies).execute( | ||
searchKey, | ||
Number(req.params.page) || 1, | ||
Number(req.params.limit) || 4, | ||
); | ||
|
||
res.status(200).json({ message: 'all recruiters', data: { recruiters, numberOfPages } }); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import searchController from "./search.controller" | ||
import { IDependency } from '../../frameworks/types/dependency'; | ||
|
||
export = (dependencies: IDependency) => { | ||
return { | ||
searchController: searchController(dependencies), | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Request, Response } from 'express'; | ||
import { IDependency } from '../../frameworks/types/dependency'; | ||
|
||
export = (dependencies: IDependency) => { | ||
const { | ||
useCases: { searchUseCase }, | ||
} = dependencies; | ||
|
||
return async (req: Request, res: Response) => { | ||
const { type: resourceType } = req.params; | ||
const { searchKey } = req.query; | ||
const { result, numberOfPages } = await searchUseCase(dependencies).execute( | ||
resourceType, | ||
searchKey as string, | ||
Number(req.params.page) || 1, | ||
Number(req.params.limit) || 4, | ||
); | ||
|
||
res.status(200).json({ | ||
message: 'search results fetched successfully', | ||
data: { result, numberOfPages }, | ||
}); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import express, { Router } from 'express'; | ||
import { IDependency } from '../../types/dependency'; | ||
import { searchControllers } from '../../../controllers'; | ||
|
||
export const searchRouter = (dependencies: IDependency) => { | ||
const router: Router = express.Router(); | ||
|
||
const searchController = searchControllers(dependencies); | ||
|
||
router.get('/:type/:page/:limit/', searchController.searchController); | ||
|
||
return router; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.