Skip to content

Commit

Permalink
Update callers of entity field 'getters' to be async
Browse files Browse the repository at this point in the history
  • Loading branch information
Misterblue committed Feb 4, 2021
1 parent 2ac1150 commit de32d0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/route-tools/Validators.ts
Expand Up @@ -183,18 +183,18 @@ export async function verifyAllSArraySetValues(pValue: any, pCheckFunction: Vali
};

// ======== GETTER ============================================================
export function noGetter(pField: FieldDefn, pEntity: Entity): any {
export async function noGetter(pField: FieldDefn, pEntity: Entity): Promise<any> {
Logger.error(`noGetter: attempt to get field ${pField.entity_field}`);
};
// Return the field value.
export function simpleGetter(pField: FieldDefn, pEntity: Entity): any {
export async function simpleGetter(pField: FieldDefn, pEntity: Entity): Promise<any> {
if (pEntity.hasOwnProperty(pField.entity_field)) {
return (pEntity as any)[pField.entity_field];
};
return undefined;
};
// Return a date field as an ISO formatted string
export function dateStringGetter(pField: FieldDefn, pEntity: Entity): string {
export async function dateStringGetter(pField: FieldDefn, pEntity: Entity): Promise<string> {
if (pEntity.hasOwnProperty(pField.entity_field)) {
const dateVal: Date = (pEntity as any)[pField.entity_field];
return dateVal ? dateVal.toISOString() : undefined;
Expand Down

0 comments on commit de32d0a

Please sign in to comment.