Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GET /api/v2/schema/<schema_id> #668

Merged
merged 3 commits into from
Aug 8, 2023

Conversation

JR40159
Copy link
Member

@JR40159 JR40159 commented Aug 7, 2023

No description provided.

@@ -24,7 +24,7 @@ export const getSchemas = [
async (req: Request, res: Response<GetSchemaResponse>) => {
const { query } = parse(req, getSchemasSchema)

const schemas = await findSchemasByKind(query.kind)
const schemas = await getSchemasByKind(query.kind)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am tempted to say that request functions should have names like getSchemas and postResult, etc. Services should be independent of HTTP request language and so use phrasing like createSchema or findSchemas or readSchema.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made this change to follow the convention you've implemented in your PR....

}

const Schema: any = vi.fn(() => ({
save: mockedMethods.save,
}))
Schema.find = mockedMethods.find
Schema.deleteOne = mockedMethods.deleteOne
;(Schema.findOne = mockedMethods.findOne), (Schema.deleteOne = mockedMethods.deleteOne)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is going on here?! Put it on multiple lines!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caused by running npm run style, not sure why

@JR40159 JR40159 merged commit d008495 into main Aug 8, 2023
@JR40159 JR40159 deleted the feature/BAI-797-get-api-v2-schemas-schema_id branch August 8, 2023 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants