Skip to content

Commit

Permalink
Merge pull request #22 from erik1110/feature/api
Browse files Browse the repository at this point in the history
[feat] return all rooms
  • Loading branch information
erik1110 committed Feb 3, 2024
2 parents 985fb2d + 5de2bef commit 77dc907
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 77dc907

Please sign in to comment.