-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): make model and resposiory customizable
now user can use the default as well as their custom respository GH-121
- Loading branch information
1 parent
912105c
commit 37ea818
Showing
12 changed files
with
167 additions
and
106 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
15 changes: 5 additions & 10 deletions
15
src/__tests__/acceptance/fixtures/repositories/audit.repository.ts
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 |
---|---|---|
@@ -1,18 +1,13 @@ | ||
import {DefaultCrudRepository, Entity, juggler} from '@loopback/repository'; | ||
import {DefaultCrudRepository, juggler} from '@loopback/repository'; | ||
import {TestAuditLog} from '../models/audit.model'; | ||
import {tenantGuard} from '@sourceloop/core'; | ||
import {inject} from '@loopback/core'; | ||
|
||
@tenantGuard() | ||
export class TestAuditLogRepository extends DefaultCrudRepository< | ||
TestAuditLog, | ||
typeof TestAuditLog.prototype.id | ||
typeof TestAuditLog.prototype.id, | ||
{} | ||
> { | ||
constructor( | ||
@inject('datasources.AuditDB') dataSource: juggler.DataSource, | ||
@inject('models.AuditLog') | ||
private readonly auditLog: typeof Entity & {prototype: TestAuditLog}, | ||
) { | ||
super(auditLog, dataSource); | ||
constructor(@inject('datasources.AuditDB') dataSource: juggler.DataSource) { | ||
super(TestAuditLog, dataSource); | ||
} | ||
} |
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.