-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: rajapinta projektin hakemiselle Velhosta
- Loading branch information
1 parent
c87cc04
commit 414d4ab
Showing
17 changed files
with
456 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
export class VelhoError extends Error { | ||
constructor(m?: string) { | ||
super(m ? m : ""); | ||
constructor(m?: string, error?: any) { | ||
super(m ? m + (error ? JSON.stringify(error.response?.data) : "") : ""); | ||
|
||
// Set the prototype explicitly. | ||
Object.setPrototypeOf(this, VelhoError.prototype); | ||
// Make the log show VelhoError instead of Error in the stack trace | ||
this.name = new.target.name; | ||
Object.setPrototypeOf(this, new.target.prototype); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
backend/test/velho/__snapshots__/velhoAdapter.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`VelhoAdapter should adapt project from Velho successfully 1`] = ` | ||
Object { | ||
"__typename": "Projekti", | ||
"nimi": "Kaupungin sisääntulotien (mt 123) parantaminen välillä valtatien 1 eritasoliittymä - Päätie, Helsinki", | ||
"oid": "100", | ||
"organisaatio": "Pirkanmaan ELY-keskus", | ||
"tila": "Vastaanotettu", | ||
"toteutusAjankohta": "Toteutettavissa arviolta noin 1 vuoden päästä nykyhetkestä", | ||
"tyyppi": "Tiesuunnitelma/Tie- ja rakennussuunnitelma", | ||
"vaylamuoto": Array [ | ||
"tie", | ||
], | ||
} | ||
`; |
Oops, something went wrong.