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 { DrizzleModule } from "./drizzle/drizzle.module";
|
||||
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({
|
||||
imports: [
|
||||
@ -20,6 +23,9 @@ import { LogService } from "./logger/logger.service";
|
||||
DrizzleModule,
|
||||
AuthModule,
|
||||
CredentialsModule,
|
||||
ProductsModule,
|
||||
StocksModule,
|
||||
TransactionsModule,
|
||||
],
|
||||
exports: [LogService],
|
||||
controllers: [],
|
||||
|
@ -75,7 +75,7 @@ export class AuthService implements OnModuleInit {
|
||||
};
|
||||
}
|
||||
|
||||
async fetchUser(userId: string) {
|
||||
async fetchUser() {
|
||||
//TODO Pagination
|
||||
const usersInDb = await this.db.use().select().from(UsersTable);
|
||||
const result = {
|
||||
@ -88,6 +88,7 @@ export class AuthService implements OnModuleInit {
|
||||
}),
|
||||
};
|
||||
console.log(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
async updateUser(targetId: string, userData: IUserUpdateData) {
|
||||
@ -133,7 +134,7 @@ export class AuthService implements OnModuleInit {
|
||||
|
||||
async onModuleInit() {
|
||||
setTimeout(() => {
|
||||
this.fetchUser("ee");
|
||||
this.fetchUser();
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user