Skip to content

Commit 615a856

Browse files
committed
clean up repo
1 parent 5d6e13e commit 615a856

11 files changed

+29
-347
lines changed
Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,39 @@
11
import { Injectable } from '@nestjs/common';
22
import { InjectModel } from '@nestjs/mongoose';
33
import { Identities } from './_schemas/identities.schema';
4-
import { Model } from 'mongoose';
4+
import { Document, Model, ModifyResult, Query, QueryOptions, SaveOptions, Types, UpdateQuery } from 'mongoose';
55
import { AbstractServiceSchema } from '~/_common/abstracts/abstract.service.schema';
6+
import { AbstractSchema } from '~/_common/abstracts/schemas/abstract.schema';
67

78
@Injectable()
89
export class IdentitiesService extends AbstractServiceSchema {
910
constructor(@InjectModel(Identities.name) protected _model: Model<Identities>) {
1011
super();
1112
}
13+
14+
15+
public async create<T extends AbstractSchema | Document>(data?: any, options?: SaveOptions): Promise<Document<T, any, T>> {
16+
// noinspection UnnecessaryLocalVariableJS
17+
const created: Document<T, any, T> = await super.create(data, options);
18+
//TODO: add backends service logic here
19+
return created;
20+
}
21+
22+
public async update<T extends AbstractSchema | Document>(
23+
_id: Types.ObjectId | any,
24+
update: UpdateQuery<T>,
25+
options?: QueryOptions<T> & { rawResult: true },
26+
): Promise<ModifyResult<Query<T, T, any, T>>> {
27+
// noinspection UnnecessaryLocalVariableJS
28+
const updated = await super.update(_id, update, options);
29+
//TODO: add backends service logic here
30+
return updated;
31+
}
32+
33+
public async delete<T extends AbstractSchema | Document>(_id: Types.ObjectId | any, options?: QueryOptions<T> | null | undefined): Promise<Query<T, T, any, T>> {
34+
// noinspection UnnecessaryLocalVariableJS
35+
const deleted = await super.delete(_id, options);
36+
//TODO: add backends service logic here
37+
return deleted;
38+
}
1239
}

src/management/management.module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ import { DynamicModule, Module } from '@nestjs/common';
22
import { ManagementService } from './management.service';
33
import { ManagementController } from './management.controller';
44
import { RouterModule } from '@nestjs/core';
5-
import { PasswdModule } from './passwd/passwd.module';
65
import { IdentitiesModule } from './identities/identities.module';
76

87
@Module({
9-
imports: [PasswdModule, IdentitiesModule],
8+
imports: [IdentitiesModule],
109
providers: [ManagementService],
1110
controllers: [ManagementController],
1211
})

src/management/passwd/dto/ask-token.dto.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/management/passwd/dto/change-password.dto.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/management/passwd/dto/reset-password.dto.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/management/passwd/dto/verify-token.dto.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/management/passwd/passwd.controller.spec.ts.old

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/management/passwd/passwd.controller.ts

Lines changed: 0 additions & 89 deletions
This file was deleted.

src/management/passwd/passwd.module.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/management/passwd/passwd.service.spec.ts.old

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)