async findAll()

in services/shared/apps/tenant-management/src/tenants/tenants.service.ts [18:38]


  async findAll() {
    console.log('Get all tenants');
    const client = this.clientFac.client;
    try {
      const cmd = new ScanCommand({
        TableName: this.tableName,
      });
      const response = await client.send(cmd);
      console.log('Response:', response);
      return JSON.stringify(response.Items);
    } catch (error) {
      console.error(error);
      throw new HttpException(
        {
          status: HttpStatus.INTERNAL_SERVER_ERROR,
          error: error,
        },
        HttpStatus.INTERNAL_SERVER_ERROR,
      );
    }
  }