First part of the action comment refactoring
ref #39 Why did i volunteer for this? It's just a glorified sleeping aid 😴
This commit is contained in:
@@ -5,17 +5,21 @@ import { Address } from '../entities/Address';
|
||||
import { RunnerOrganisation } from '../entities/RunnerOrganisation';
|
||||
import { CreateRunnerGroup } from './CreateRunnerGroup';
|
||||
|
||||
/**
|
||||
* This class is used to update a RunnerOrganisation entity (via put request).
|
||||
*/
|
||||
export class UpdateRunnerOrganisation extends CreateRunnerGroup {
|
||||
|
||||
/**
|
||||
* The updated orgs's id.
|
||||
* This shouldn't have changed but it is here in case anyone ever wants to enable id changes (whyever they would want to).
|
||||
*/
|
||||
@IsInt()
|
||||
id: number;
|
||||
|
||||
/**
|
||||
* The updated organisation's address.
|
||||
* Must be of type number (address id).
|
||||
* Just has to contain the address's id - everything else won't be checked or changed.
|
||||
* Optional.
|
||||
*/
|
||||
@IsInt()
|
||||
@@ -23,7 +27,7 @@ export class UpdateRunnerOrganisation extends CreateRunnerGroup {
|
||||
address?: Address;
|
||||
|
||||
/**
|
||||
* Get's this org's address from this.address.
|
||||
* Loads the organisation's address based on it's id.
|
||||
*/
|
||||
public async getAddress(): Promise<Address> {
|
||||
if (this.address === undefined || this.address === null) {
|
||||
@@ -35,7 +39,7 @@ export class UpdateRunnerOrganisation extends CreateRunnerGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a RunnerTeam entity from this.
|
||||
* Updates a provided RunnerOrganisation entity based on this.
|
||||
*/
|
||||
public async updateRunnerOrganisation(organisation: RunnerOrganisation): Promise<RunnerOrganisation> {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user