Renamed the update>Entity Name>() functiuons to update()

ref #76
This commit is contained in:
2021-01-10 16:35:52 +01:00
parent e6b9d4f273
commit 3f7b0f6563
19 changed files with 20 additions and 20 deletions

View File

@@ -26,7 +26,7 @@ export class UpdateDonor extends CreateParticipant {
/**
* Updates a provided Donor entity based on this.
*/
public async updateDonor(donor: Donor): Promise<Donor> {
public async update(donor: Donor): Promise<Donor> {
donor.firstname = this.firstname;
donor.middlename = this.middlename;
donor.lastname = this.lastname;

View File

@@ -42,7 +42,7 @@ export class UpdatePermission {
/**
* Updates a provided Permission entity based on this.
*/
public async updatePermission(permission: Permission): Promise<Permission> {
public async update(permission: Permission): Promise<Permission> {
permission.principal = await this.getPrincipal();
permission.target = this.target;
permission.action = this.action;

View File

@@ -29,7 +29,7 @@ export class UpdateRunner extends CreateParticipant {
/**
* Updates a provided Runner entity based on this.
*/
public async updateRunner(runner: Runner): Promise<Runner> {
public async update(runner: Runner): Promise<Runner> {
runner.firstname = this.firstname;
runner.middlename = this.middlename;
runner.lastname = this.lastname;

View File

@@ -41,7 +41,7 @@ export class UpdateRunnerOrganisation extends CreateRunnerGroup {
/**
* Updates a provided RunnerOrganisation entity based on this.
*/
public async updateRunnerOrganisation(organisation: RunnerOrganisation): Promise<RunnerOrganisation> {
public async update(organisation: RunnerOrganisation): Promise<RunnerOrganisation> {
organisation.name = this.name;
organisation.contact = await this.getContact();

View File

@@ -45,7 +45,7 @@ export class UpdateRunnerTeam extends CreateRunnerGroup {
/**
* Updates a provided RunnerTeam entity based on this.
*/
public async updateRunnerTeam(team: RunnerTeam): Promise<RunnerTeam> {
public async update(team: RunnerTeam): Promise<RunnerTeam> {
team.name = this.name;
team.parentGroup = await this.getParent();

View File

@@ -41,7 +41,7 @@ export abstract class UpdateScan {
* Update a Scan entity based on this.
* @param scan The scan that shall be updated.
*/
public async updateScan(scan: Scan): Promise<Scan> {
public async update(scan: Scan): Promise<Scan> {
scan.distance = this.distance;
scan.valid = this.valid;
scan.runner = await this.getRunner();

View File

@@ -30,7 +30,7 @@ export class UpdateScanStation {
* Update a ScanStation entity based on this.
* @param station The station that shall be updated.
*/
public async updateStation(station: ScanStation): Promise<ScanStation> {
public async update(station: ScanStation): Promise<ScanStation> {
station.description = this.description;
station.enabled = this.enabled;

View File

@@ -37,7 +37,7 @@ export class UpdateTrack {
* Update a Track entity based on this.
* @param track The track that shall be updated.
*/
public updateTrack(track: Track): Track {
public update(track: Track): Track {
track.name = this.name;
track.distance = this.distance;
track.minimumLapTime = this.minimumLapTime;

View File

@@ -44,7 +44,7 @@ export abstract class UpdateTrackScan {
* Update a TrackScan entity based on this.
* @param scan The scan that shall be updated.
*/
public async updateScan(scan: TrackScan): Promise<TrackScan> {
public async update(scan: TrackScan): Promise<TrackScan> {
scan.valid = this.valid;
if (this.runner) {
scan.runner = await this.getRunner();

View File

@@ -98,7 +98,7 @@ export class UpdateUser {
* Updates a user entity based on this.
* @param user The user that shall be updated.
*/
public async updateUser(user: User): Promise<User> {
public async update(user: User): Promise<User> {
user.email = this.email;
user.username = this.username;
if ((user.email === undefined || user.email === null) && (user.username === undefined || user.username === null)) {