-
Notifications
You must be signed in to change notification settings - Fork 15
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
Initial model card and schema routes #692
Conversation
export interface ModelCardInterface { | ||
schemaId: string | ||
version: number | ||
createdBy: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this going to be just the username or is it worth adding in the full entity object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should always use users
whenever it's an action done by someone. There's never a 'group' that creates a release, it's always a specific person. (Also, entities are now strings of the form ${type}:${id}
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sorry I forgot the change in entity format, yeah I agree with this in that case.
|
||
version: 1, | ||
metadata: { example: true }, | ||
console.log('CARD', card) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this added during development or do we need to log this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. I had some issues mocking and fell back to some console logging that I clearly forgot to remove. Nice catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do it all the time :D
|
||
version: 1, | ||
metadata: { example: true }, | ||
if (!card) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this logic not in the service?
} as const | ||
export type GetModelCardVersionOptionsKeys = | ||
(typeof GetModelCardVersionOptions)[keyof typeof GetModelCardVersionOptions] | ||
export async function getModelCard(user: UserDoc, modelId: string, version: number | GetModelCardVersionOptionsKeys) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we agreed not to use http methods in service names? Should this be f'indModelCardByModelId'?
@@ -2,19 +2,16 @@ import bodyParser from 'body-parser' | |||
import { Request, Response } from 'express' | |||
import { z } from 'zod' | |||
|
|||
import { ModelCardInterface } from '../../../../models/v2/ModelCard.js' | |||
import { ModelCardInterface } from '../../../../models/v2/Model.js' | |||
import { getModelCard as getModelCardService, GetModelCardVersionOptions } from '../../../../services/v2/model.js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you renaming this method? See previous comment about using http methods in service method names
This adds routes for: