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:
Mathis H (Avnyr) 2024-07-12 14:25:05 +02:00
parent b03b178fe3
commit 2a879c71f1
Signed by: Mathis
GPG Key ID: DD9E0666A747D126
2 changed files with 9 additions and 2 deletions

View File

@ -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: [],

View File

@ -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);
} }
} }