Fix/events from caldav not taken into consideration when checking availability (#637)
* use version 1.0.6 * use logger over console log fix typing issue Co-authored-by: Bailey Pumfleet <pumfleet@hey.com>
This commit is contained in:
parent
2cf02c4f31
commit
ed8241ac1b
3 changed files with 57 additions and 56 deletions
|
@ -17,7 +17,7 @@ import { v4 as uuidv4 } from "uuid";
|
||||||
import { stripHtml } from "../../emails/helpers";
|
import { stripHtml } from "../../emails/helpers";
|
||||||
import logger from "@lib/logger";
|
import logger from "@lib/logger";
|
||||||
|
|
||||||
const log = logger.getChildLogger({ prefix: ["[[lib] caldav"] });
|
const log = logger.getChildLogger({ prefix: ["[lib] caldav"] });
|
||||||
|
|
||||||
type EventBusyDate = Record<"start" | "end", Date>;
|
type EventBusyDate = Record<"start" | "end", Date>;
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ export class CalDavCalendar implements CalendarApiAdapter {
|
||||||
id: uid,
|
id: uid,
|
||||||
};
|
};
|
||||||
} catch (reason) {
|
} catch (reason) {
|
||||||
console.error(reason);
|
log.error(reason);
|
||||||
throw reason;
|
throw reason;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,7 @@ export class CalDavCalendar implements CalendarApiAdapter {
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
} catch (reason) {
|
} catch (reason) {
|
||||||
console.error(reason);
|
log.error(reason);
|
||||||
throw reason;
|
throw reason;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -193,7 +193,7 @@ export class CalDavCalendar implements CalendarApiAdapter {
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
} catch (reason) {
|
} catch (reason) {
|
||||||
console.error(reason);
|
log.error(reason);
|
||||||
throw reason;
|
throw reason;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -260,7 +260,7 @@ export class CalDavCalendar implements CalendarApiAdapter {
|
||||||
integration: this.integrationName,
|
integration: this.integrationName,
|
||||||
}));
|
}));
|
||||||
} catch (reason) {
|
} catch (reason) {
|
||||||
console.error(reason);
|
log.error(reason);
|
||||||
throw reason;
|
throw reason;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,10 +281,11 @@ export class CalDavCalendar implements CalendarApiAdapter {
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
});
|
});
|
||||||
|
|
||||||
const events =
|
if (!objects || objects?.length === 0) {
|
||||||
objects &&
|
return [];
|
||||||
objects?.length > 0 &&
|
}
|
||||||
objects
|
|
||||||
|
const events = objects
|
||||||
.map((object) => {
|
.map((object) => {
|
||||||
if (object?.data) {
|
if (object?.data) {
|
||||||
const jcalData = ICAL.parse(object.data);
|
const jcalData = ICAL.parse(object.data);
|
||||||
|
@ -332,7 +333,7 @@ export class CalDavCalendar implements CalendarApiAdapter {
|
||||||
|
|
||||||
return events;
|
return events;
|
||||||
} catch (reason) {
|
} catch (reason) {
|
||||||
console.error(reason);
|
log.error(reason);
|
||||||
throw reason;
|
throw reason;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
"react-select": "^4.3.1",
|
"react-select": "^4.3.1",
|
||||||
"react-timezone-select": "^1.0.7",
|
"react-timezone-select": "^1.0.7",
|
||||||
"short-uuid": "^4.2.0",
|
"short-uuid": "^4.2.0",
|
||||||
"tsdav": "^1.0.6",
|
"tsdav": "1.0.6",
|
||||||
"tslog": "^3.2.1",
|
"tslog": "^3.2.1",
|
||||||
"uuid": "^8.3.2"
|
"uuid": "^8.3.2"
|
||||||
},
|
},
|
||||||
|
|
|
@ -7489,10 +7489,10 @@ ts-pnp@^1.1.6:
|
||||||
resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92"
|
resolved "https://registry.yarnpkg.com/ts-pnp/-/ts-pnp-1.2.0.tgz#a500ad084b0798f1c3071af391e65912c86bca92"
|
||||||
integrity sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw==
|
integrity sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw==
|
||||||
|
|
||||||
tsdav@^1.0.6:
|
tsdav@1.0.6:
|
||||||
version "1.1.0"
|
version "1.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/tsdav/-/tsdav-1.1.0.tgz#48fe17df07f852ff8dfddf71fae2396e79ed6735"
|
resolved "https://registry.yarnpkg.com/tsdav/-/tsdav-1.0.6.tgz#65c22fc77d6516db234c1288ff9c9fed6730fef5"
|
||||||
integrity sha512-Cc/VTFgUC/fOOFkGT/xuwrrIrG0+it7WA5ywNM4QyYWAzXVw+WmbM1pr7/7fzHA/OOVQ0a8RyPi4K1C+mFBGJw==
|
integrity sha512-xnKE39wZtyLoyW1UClYAb2Eilx6tHzbqhO2v29P1zrmwLAsKNYUHwHb+lrmJHfZZLsbbzKWRg5dPLYRuEXmMJA==
|
||||||
dependencies:
|
dependencies:
|
||||||
base-64 "^1.0.0"
|
base-64 "^1.0.0"
|
||||||
cross-fetch "^3.1.4"
|
cross-fetch "^3.1.4"
|
||||||
|
|
Loading…
Reference in a new issue