Conversation
|
A live preview of this PR will be available at the URL below and will update on each commit. = https://pr1421---site-khswqo4xea-wl.a.run.app/
|
aomarks
left a comment
There was a problem hiding this comment.
Needs a test? Lots of things could go wrong here, e.g. the graphql query is unvalidated I believe?
| export class WCOCatalogImportPage extends WCOPage { | ||
| private _importTask = new Task(this, { | ||
| task: async ([packageName]: [packageName: string | undefined]) => { | ||
| console.log('_importTask', packageName); |
| packageName, | ||
| }), | ||
| }); | ||
| const result = await response.json(); |
There was a problem hiding this comment.
Think we need to check the response code before parsing the json? Since fetch doesn't throw on HTTP errors.
There was a problem hiding this comment.
I think we can let .json() throw and add a error template.
| unknown | ||
| > | ||
| ) => { | ||
| console.log('context.request.body', context.request.body); |
This adds a
/catalog/importGET endpoint for the import page and POST endpoint for the import operation.The page is extremely basic and just dumps the JSON output of the response to the screen.
Did a few cleanups on route file organization to make things simpler too.