Skip to content

Commit

Permalink
[Fix] Fix APP history permit type badge (#273)
Browse files Browse the repository at this point in the history
* Query permitType field for all application types

* Fix TS build error
  • Loading branch information
OustanDing authored and leogjhuang committed Oct 10, 2023
1 parent 9803159 commit 1c51696
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
19 changes: 4 additions & 15 deletions tools/admin/permit-holders/app-history.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
import {
Application,
ApplicationProcessing,
Invoice,
NewApplication,
Permit,
PermitType,
} from '@lib/graphql/types';
import { Application, ApplicationProcessing, Invoice, Permit } from '@lib/graphql/types';

/** APP history entry record (API response) */
export type AppHistoryRecord = Pick<Permit, 'rcdPermitId' | 'expiryDate'> & {
application: Pick<Application, 'id'> & {
application: Pick<Application, 'id' | 'type' | 'permitType'> & {
processing: Pick<ApplicationProcessing, 'documentsUrl' | 'documentsS3ObjectKey'> & {
invoice: Pick<Invoice, 's3ObjectUrl' | 's3ObjectKey'>;
};
} & (
| ({ type: 'NEW' } & Pick<NewApplication, 'permitType'>)
| { type: 'RENEWAL' | 'REPLACEMENT'; permitType: undefined }
);
};
};

/** APP history entry row in APP history card (FE) */
export type PermitRecord = Pick<Permit, 'rcdPermitId' | 'expiryDate'> & {
application: Pick<Application, 'id' | 'type'> & {
application: Pick<Application, 'id' | 'type' | 'permitType'> & {
processing: Pick<ApplicationProcessing, 'documentsUrl' | 'documentsS3ObjectKey'> & {
invoice: Pick<Invoice, 's3ObjectUrl' | 's3ObjectKey'>;
};
permitType: PermitType | undefined;
};
};
4 changes: 1 addition & 3 deletions tools/admin/permit-holders/view-permit-holder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export const GET_APPLICANT_QUERY = gql`
application {
id
type
permitType
processing {
documentsUrl
documentsS3ObjectKey
Expand All @@ -99,9 +100,6 @@ export const GET_APPLICANT_QUERY = gql`
s3ObjectKey
}
}
... on NewApplication {
permitType
}
}
}
}
Expand Down

0 comments on commit 1c51696

Please sign in to comment.