Skip to content

Commit

Permalink
[feat] return all rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
erik1110 committed Feb 3, 2024
1 parent 13d5a4b commit 5de2bef
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/features/room/room.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,10 @@ export class RoomService {
constructor(@InjectModel('Room') private readonly roomModel: Model<IRoom>) {}

async getallRooms(req: Request) {
const result = await this.roomModel.find(
{
status: 1,
},
'_id',
);
const ids = result.map((order) => order._id.toString());
const result = await this.roomModel.find({ status: 1});
return getHttpResponse.successResponse({
message: '取得所有房型',
data: ids,
data: result,
});
}

Expand Down

0 comments on commit 5de2bef

Please sign in to comment.