-
Notifications
You must be signed in to change notification settings - Fork 0
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
Content registration #9
Conversation
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.
Very nice that you added some more examples, the ones for the curl command and the schema payload.
tagTypes: ['schemaApi'], | ||
extractRehydrationInfo(action, { reducerPath }) { | ||
if (action.type === HYDRATE) { | ||
return action.payload[reducerPath]; | ||
} | ||
}, | ||
endpoints: (builder) => ({ | ||
putSchema: builder.mutation<SchemaFormType, SchemaFormType>({ | ||
putSchema: builder.mutation<any, any>({ |
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.
Should there maybe be a proper type/interface here instead of any? Seems like a place where you would like to leverage typing checks, to make sure you're sending a valid payload, and getting back data the way you want?
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.
it was quick do over to make the put work. I have to think about the correct interface type that the backend accepts.
@@ -73,6 +74,7 @@ export default function UpdateWithFileModal({ | |||
if (fileData) { | |||
const formData = new FormData(); | |||
formData.append('file', fileData); | |||
console.log('in file modal' + formData); |
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.
Should we maybe clean up console logs as well? We don't want them to end up in production, at least.
key={item.pid} | ||
onClick={() => handleClick(item.pid)} | ||
onMouseEnter={() => item.onMouseEnter && item.onMouseEnter()} | ||
onMouseLeave={() => item.onMouseLeave && item.onMouseLeave()} |
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.
Are these supposed to do something? Did these not break, since you removed the onMouseLeave and onMouseEnter attributes from the Schema interface?
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.
no, I will add the click event on the list component :)
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.
At some point we need to change every 'status' into state, since I think that's the term we have decided to use in MSCR for draft/published etc. Also we need to refactor overlapping interfaces.
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!
}, [schemaFormInitialData]); | ||
|
||
useEffect(() => { | ||
if (userPosted && result.isSuccess) { | ||
if ((userPosted && resultSchema.isSuccess) || resultSchema.isSuccess) { |
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 it just my Friday afternoon brain, or does the userPosted not really matter in this condition? If resultSchema.isSuccess is true, this statement is true regardless of userPosted, right?
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.
it was my friday afternoon brain!! good catch. This does not make any sense. I will fix it
Schema Registrationa with File or only with metadata is working with the real datamodel api backend. Features working are