Skip to content

Commit

Permalink
fix: fixed draft deletion of filings (#38)
Browse files Browse the repository at this point in the history
* fix: fixed draft deletion of filings

* fix: fixed in response to Sev's comment
  • Loading branch information
JazzarKarim authored Dec 23, 2024
1 parent 04877e1 commit 6b7bbab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions business-registry-dashboard/app/stores/affiliations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ export const useAffiliationsStore = defineStore('brd-affiliations-store', () =>
}

async function removeBusiness (payload: RemoveBusinessPayload) {
// If the business is a new registration then remove the business filing from legal-db
if (payload.business.corpType.code === CorpTypes.INCORPORATION_APPLICATION) {
// If the business is a new IA, amalgamation, or registration then remove the business filing from legal-db
// TODO: Add continuation in to the list of filings to remove (for MVP)
if ([
CorpTypes.INCORPORATION_APPLICATION,
CorpTypes.AMALGAMATION_APPLICATION,
CorpTypes.REGISTRATION
].includes(payload.business.corpType.code)) {
const filingResponse = await getFilings(payload.business.businessIdentifier)
if (filingResponse && filingResponse.status === 200) { // TODO: fix typing
if (filingResponse) {
const filingId = filingResponse.filing?.header?.filingId // TODO: fix typing
// If there is a filing delete it which will delete the affiliation, else delete the affiliation
if (filingId) {
Expand Down
2 changes: 1 addition & 1 deletion business-registry-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "business-registry-dashboard",
"private": true,
"type": "module",
"version": "0.0.10",
"version": "0.0.11",
"scripts": {
"build-check": "nuxt build",
"build": "nuxt generate",
Expand Down

0 comments on commit 6b7bbab

Please sign in to comment.