@loomcore/api 0.1.107 → 0.1.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7,6 +7,10 @@ export declare class OrganizationsController extends ApiController<IOrganization
|
|
|
7
7
|
orgService: OrganizationService;
|
|
8
8
|
constructor(app: Application, database: IDatabase);
|
|
9
9
|
mapRoutes(app: Application): void;
|
|
10
|
-
getByName(req: Request
|
|
11
|
-
|
|
10
|
+
getByName(req: Request<{
|
|
11
|
+
name: string;
|
|
12
|
+
}>, res: Response, next: NextFunction): Promise<void>;
|
|
13
|
+
getByCode(req: Request<{
|
|
14
|
+
code: string;
|
|
15
|
+
}>, res: Response, next: NextFunction): Promise<void>;
|
|
12
16
|
}
|
|
@@ -17,7 +17,7 @@ export class OrganizationsController extends ApiController {
|
|
|
17
17
|
}
|
|
18
18
|
async getByName(req, res, next) {
|
|
19
19
|
console.log('in OrganizationController.getByName');
|
|
20
|
-
|
|
20
|
+
const { name } = req.params;
|
|
21
21
|
try {
|
|
22
22
|
res.set('Content-Type', 'application/json');
|
|
23
23
|
const entity = await this.orgService.findOne(req.userContext, { filters: { name: { contains: name } } });
|
|
@@ -31,7 +31,7 @@ export class OrganizationsController extends ApiController {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
async getByCode(req, res, next) {
|
|
34
|
-
|
|
34
|
+
const { code } = req.params;
|
|
35
35
|
try {
|
|
36
36
|
res.set('Content-Type', 'application/json');
|
|
37
37
|
const entity = await this.orgService.findOne(req.userContext, { filters: { code: { eq: code } } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loomcore/api",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.111",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Loom Core Api - An opinionated Node.js api using Typescript, Express, and MongoDb or PostgreSQL",
|
|
6
6
|
"scripts": {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"qs": "^6.15.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@loomcore/common": "^0.0.
|
|
60
|
+
"@loomcore/common": "^0.0.52",
|
|
61
61
|
"@sinclair/typebox": "0.34.33",
|
|
62
62
|
"cookie-parser": "^1.4.6",
|
|
63
63
|
"cors": "^2.8.5",
|