-
-
Notifications
You must be signed in to change notification settings - Fork 1
Creating a collection #43
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
Conversation
sakithb
commented
Aug 30, 2025
- ui
- add bottom margin
- endpoint + tests
- fix failing test
- wip
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.
Update all controllers to use AuthorizqtionListener::getUser and remove uses of getUser()
# Conflicts: # backend/composer.json # backend/composer.lock # backend/src/Api/App/Controller/CollectionController.php # backend/src/Api/App/Controller/PublicationController.php # backend/src/Repository/CollectionUserRepository.php
Nadil-K
left a comment
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.
- Add a test for
POST /collections - In the frontend, move API calls to a separate
tsfile (See this)
| throw new AccessDeniedHttpException('Authentication required'); | ||
| } | ||
|
|
||
| $data = json_decode($request->getContent() ?: 'null', true); |
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.
- Populate a typed input object with
#[MapRequestPayload]. - Do the validations within that object class.
|
|
||
| return $this->json([ | ||
| 'publication' => new \App\Api\App\Object\PublicationObject($publication), | ||
| 'created' => $created, |
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 do we need these created and attached booleans? Within the current codebase, I don't see any instance of it being used. Shall we remove it @supun-io?
| $attached = false; | ||
|
|
||
| if (!$publication) { | ||
| $publication = $this->publicationService->createPublication($collection, $url, $title ?: null); |
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.
- Add an optional parameter
flush = trueforcreatePublicationand within the function, only flush the EntityManager if it'strue. - In this case, set that bool to
falsesince we flush it again below. - Do the same for
attachToCollectionIfMissing.
| {/snippet} | ||
| </Modal> | ||
|
|
||
| <slot /> |
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.
<slot />is deprecated in Svelte 5. Use{@render children()}instead.
| {/snippet} | ||
| </Modal> | ||
|
|
||
| <Modal |
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.
- Duplicate
| </div> | ||
| </Modal> | ||
|
|
||
| <Modal bind:show={showAddPublicationModal} size="small" title="Add Publication" closeOnOutsideClick={true} closeOnEscape={true}> |
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.
- Duplicate
| {collection.name} | ||
| </ActionListItem> | ||
| {/each} | ||
| <ActionListItem on:select={() => { showCreateCollectionModal = true; showCollections = false; }}> |
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.
- Use a
Buttoninstead