Skip to content

Commit

Permalink
Merge pull request #453 from ITPNYU/main
Browse files Browse the repository at this point in the history
Converting an Number to String
  • Loading branch information
rlho authored Oct 7, 2024
2 parents efdfe36 + 65724af commit 3b8698e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions booking-app/app/api/syncCalendars/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import { NextResponse } from "next/server";

const db = admin.firestore();
const areRoomIdsSame = (roomIds1: string, roomIds2: string): boolean => {

const toArray = (ids: string): string[] => {
return ids.includes(',') ? ids.split(',').map(id => id.trim()) : [ids.trim()];
};

const sortedRoomIds1 = toArray(roomIds1).sort();
const sortedRoomIds2 = toArray(roomIds2).sort();
const sortedRoomIds1 = toArray(String(roomIds1)).sort();
const sortedRoomIds2 = toArray(String(roomIds2)).sort();

console.log('Comparing room IDs:', { ids1: sortedRoomIds1, ids2: sortedRoomIds2 });

Expand Down

0 comments on commit 3b8698e

Please sign in to comment.