-
Notifications
You must be signed in to change notification settings - Fork 70
/
search-query.repository.ts
36 lines (34 loc) · 1.21 KB
/
search-query.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
// 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 {AnyObject, Count, juggler, Where} from '@loopback/repository';
import {
DefaultUserModifyCrudRepository,
IAuthUserWithPermissions,
} from '@sourceloop/core';
import {AuthenticationBindings} from 'loopback4-authentication';
import {SearchServiceConfig} from '..';
import {SearchServiceBindings} from '../keys';
import {SearchQuery} from '../models';
export class SearchQueryRepository extends DefaultUserModifyCrudRepository<
SearchQuery,
typeof SearchQuery.prototype.id
> {
constructor(
@inject(`datasources.${SearchServiceBindings.DATASOURCE_NAME}`)
dataSource: juggler.DataSource,
@inject(SearchServiceBindings.Config)
private readonly config: SearchServiceConfig,
@inject.getter(AuthenticationBindings.CURRENT_USER)
protected readonly getCurrentUser: Getter<
IAuthUserWithPermissions | undefined
>,
) {
super(SearchQuery, dataSource, getCurrentUser);
}
deleteAll(where?: Where<SearchQuery>, options?: AnyObject): Promise<Count> {
return super.deleteAllHard(where, options);
}
}