Skip to content

Minor refactor required in apps/meteor/server/services/calendar/service.ts #39976

@Kaustubh2k5

Description

@Kaustubh2k5

Issue Description

i noticed that the logic of this specific format:

		await this.setupNextNotification();
		if (busy !== false) {
			await this.setupNextStatusChange();
		}

repeats in multiple parts of the code for service.ts.

Change proposed

We can change this to make the code a bit more readable and easy to maintain by creating a common helper function that can be used across the code

	private async updateSchedulers(busy?: boolean): Promise<void> {
		await this.setupNextNotification();
		// If busy is undefined, we assume true
		if (busy !== false) {
			await this.setupNextStatusChange();
		}
	}

What this does:

makes the code more readable and cleaner. and easier to maintain in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: featurePull requests that introduces new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions