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

View File

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