feat: Update fetchUser function and add new modules
Updated the 'fetchUser' function in 'auth.service.ts', removing the specific user ID parameter, and added a return statement. Moreover, 'ProductsModule', 'StocksModule', and 'TransactionsModule' have been imported to 'app.module.ts'.
This commit is contained in:
parent
b03b178fe3
commit
2a879c71f1
@ -5,6 +5,9 @@ import { AuthModule } from "./auth/auth.module";
|
|||||||
import { CredentialsModule } from "./credentials/credentials.module";
|
import { CredentialsModule } from "./credentials/credentials.module";
|
||||||
import { DrizzleModule } from "./drizzle/drizzle.module";
|
import { DrizzleModule } from "./drizzle/drizzle.module";
|
||||||
import { LogService } from "./logger/logger.service";
|
import { LogService } from "./logger/logger.service";
|
||||||
|
import { ProductsModule } from './products/products.module';
|
||||||
|
import { StocksModule } from './stocks/stocks.module';
|
||||||
|
import { TransactionsModule } from './transactions/transactions.module';
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
@ -20,6 +23,9 @@ import { LogService } from "./logger/logger.service";
|
|||||||
DrizzleModule,
|
DrizzleModule,
|
||||||
AuthModule,
|
AuthModule,
|
||||||
CredentialsModule,
|
CredentialsModule,
|
||||||
|
ProductsModule,
|
||||||
|
StocksModule,
|
||||||
|
TransactionsModule,
|
||||||
],
|
],
|
||||||
exports: [LogService],
|
exports: [LogService],
|
||||||
controllers: [],
|
controllers: [],
|
||||||
|
@ -75,7 +75,7 @@ export class AuthService implements OnModuleInit {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async fetchUser(userId: string) {
|
async fetchUser() {
|
||||||
//TODO Pagination
|
//TODO Pagination
|
||||||
const usersInDb = await this.db.use().select().from(UsersTable);
|
const usersInDb = await this.db.use().select().from(UsersTable);
|
||||||
const result = {
|
const result = {
|
||||||
@ -88,6 +88,7 @@ export class AuthService implements OnModuleInit {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
console.log(result);
|
console.log(result);
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateUser(targetId: string, userData: IUserUpdateData) {
|
async updateUser(targetId: string, userData: IUserUpdateData) {
|
||||||
@ -133,7 +134,7 @@ export class AuthService implements OnModuleInit {
|
|||||||
|
|
||||||
async onModuleInit() {
|
async onModuleInit() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.fetchUser("ee");
|
this.fetchUser();
|
||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user