-
Notifications
You must be signed in to change notification settings - Fork 70
/
theme.repository.ts
39 lines (38 loc) · 1.28 KB
/
theme.repository.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) 2023 Sourcefuse Technologies
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
import {Getter, inject} from '@loopback/core';
import {juggler, repository} from '@loopback/repository';
import {
ConditionalAuditRepositoryMixin,
IAuditMixinOptions,
} from '@sourceloop/audit-log';
import {
DefaultUserModifyCrudRepository,
IAuthUserWithPermissions,
} from '@sourceloop/core';
import {AuthenticationBindings} from 'loopback4-authentication';
import {SchedulerDatasourceName} from '../keys';
import {Theme} from '../models';
import {AuditLogRepository} from './audit.repository';
const ThemeAuditOpts: IAuditMixinOptions = {
actionKey: 'Theme_Logs',
};
export class ThemeRepository extends ConditionalAuditRepositoryMixin(
DefaultUserModifyCrudRepository<Theme, typeof Theme.prototype.id, {}>,
ThemeAuditOpts,
) {
constructor(
@inject(`datasources.${SchedulerDatasourceName}`)
dataSource: juggler.DataSource,
@inject.getter(AuthenticationBindings.CURRENT_USER)
protected readonly getCurrentUser: Getter<
IAuthUserWithPermissions | undefined
>,
@repository.getter('AuditLogRepository')
public getAuditLogRepository: Getter<AuditLogRepository>,
) {
super(Theme, dataSource, getCurrentUser);
}
}