diff --git a/backend/routes/userCollectionRoutes.js b/backend/routes/userCollectionRoutes.js index ecb09b1..3cef401 100644 --- a/backend/routes/userCollectionRoutes.js +++ b/backend/routes/userCollectionRoutes.js @@ -6,6 +6,8 @@ const EntryId = require('../models/EntryId'); const EntryRating = require('../models/EntryRating'); const { Sequelize } = require('sequelize'); const router = express.Router(); +const multer = require('multer'); +const { v4: uuidv4 } = require('uuid'); // ! /user-collections // * POST - CREATE UserCollection @@ -65,19 +67,68 @@ router.get('/:id', async (req, res) => { } }); +const storage = multer.diskStorage({ + destination: function (req, file, cb) { + cb(null, 'uploads/collections/posters/') + }, + filename: function (req, file, cb) { + const uniqueFilename = uuidv4(); + const extension = file.originalname.split('.').pop(); + cb(null, `${uniqueFilename}.${extension}`); + } +}); + +const upload = multer({ storage: storage }); + // * PUT - UPDATE A UserCollection -router.put('/:id', async (req, res) => { +router.put('/:id', upload.single('poster'), async (req, res) => { try { - const { name, description, user_rating, poster_path } = req.body; - const [updated] = await UserCollection.update({ name, description, user_rating, poster_path }, { where: { id: req.params.id } }); + const userCollectionId = req.params.id; + const { name, description, user_rating, is_poster_link } = req.body; + + let poster_path = req.file ? req.file.filename : undefined; + + const updateData = { + name, + description, + user_rating: parseInt(user_rating, 10) + }; + + if (poster_path) { + updateData.poster_path = poster_path; + } + + const updated = await UserCollection.update(updateData, { + where: { id: userCollectionId } + }); + + if (!updated[0]) { + return res.status(404).json({ message: 'UserCollection not found' }); + } if (updated) { - const updatedUserCollection = await UserCollection.findByPk(req.params.id); + const updatedUserCollection = await UserCollection.findByPk(req.params.id, { + include: [{ + model: Entry, + as: 'entries', + include: [ + { model: EntryId, as: 'entryId' }, + { model: EntryRating, as: 'entryRating' } + ], + through: { + model: UserCollectionEntry, + attributes: ['order'], // attributes (to include) from the join model + }, + }], + order: [[Sequelize.literal("`entries->UserCollectionEntry`.`order`"), 'ASC']], // sort by 'order' in ascending order + }); + res.status(200).json(updatedUserCollection); } else { res.status(404).json({ message: 'UserCollection not found' }); } } catch (error) { + console.log(`UserCollection update (put) error: `, error) res.status(500).json({ error: error.message }); } }); diff --git a/backend/server.js b/backend/server.js index 75c2c06..7a552e2 100644 --- a/backend/server.js +++ b/backend/server.js @@ -3,6 +3,7 @@ const express = require('express'); const bodyParser = require('body-parser'); const routes = require('./routes/routes.js'); const sequelize = require('./db/database.js'); +const path = require('path'); const app = express(); const PORT = process.env.PORT || 4000; @@ -25,9 +26,31 @@ app.use((req, res, next) => { next(); }); -// Routes +// ? Routes +// * media access route +app.use('/api/v1/media/:category/:type', (req, res, next) => { + const category = req.params.category; + const type = req.params.type; + + if (!['entries', 'collections', 'franchises'].includes(category)) { + return res.status(404).send('Not Found'); + } + + if (!['banners', 'posters', 'others'].includes(type)) { + return res.status(404).send('Not Found'); + } + + const options = { + fallthrough: false, // ! Important: don't call next middleware if file isn't found + }; + + express.static(path.join(__dirname, '..', `uploads/${category}/${type}`), options)(req, res, next); +}); + +// * other api routes app.use('/api/v1', routes); + // Start the server const relations = require('./db/relations.js'); const sequelizeHooks = require('./db/sequelizeHooks.js'); diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index 8b40ec0..802fe6e 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -20,11 +20,27 @@ import { LibraryComponent } from './features/library/library.component'; import { DynamicEntryListComponent } from './shared/components/lists/dynamic-entry-list/dynamic-entry-list.component'; import { NotificationPopupComponent } from './shared/components/notification-popup/notification-popup.component'; import { MainCardComponent } from './shared/components/cards/main-card/main-card.component'; -import { UserCollectionsModalComponent } from './shared/components/modals/list-selection-modal/user-collections-modal.component'; import { FavoritComponent } from './features/favorit/favorit.component'; import { WatchlistComponent } from './features/watchlist/watchlist.component'; +import { SharedModule } from './shared/shared.module'; @NgModule({ + imports: [ + CommonModule, + CoreModule, + SharedModule, + + AppRoutingModule, + + BrowserModule, + BrowserAnimationsModule, + FormsModule, + ReactiveFormsModule, + + HttpClientModule, + + DragDropModule, + ], declarations: [ AppComponent, @@ -41,21 +57,6 @@ import { WatchlistComponent } from './features/watchlist/watchlist.component'; MainCardComponent, DynamicEntryListComponent, NotificationPopupComponent, - UserCollectionsModalComponent, - ], - imports: [ - CoreModule, - CommonModule, - - AppRoutingModule, - - BrowserModule, - BrowserAnimationsModule, - HttpClientModule, - ReactiveFormsModule, - FormsModule, - - DragDropModule, ], providers: [DatePipe], bootstrap: [AppComponent], diff --git a/frontend/src/app/core/services/userCollection.service.ts b/frontend/src/app/core/services/userCollection.service.ts index a667687..ca913c3 100644 --- a/frontend/src/app/core/services/userCollection.service.ts +++ b/frontend/src/app/core/services/userCollection.service.ts @@ -36,6 +36,17 @@ export class UserCollectionService { ); } + // * PUT - update a collection + updateCollection( + userCollectionId: number, + formData: FormData + ): Observable { + return this.http.put( + `${this.backend_apiUrl}/${this.apiAction}/${userCollectionId}`, + formData + ); + } + // Delete a list by ID deleteCollection(userCollectionId: number): Observable { return this.http.delete( diff --git a/frontend/src/app/features/collections/user-collection-info/collection-edit-modal/collection-edit-modal.component.css b/frontend/src/app/features/collections/user-collection-info/collection-edit-modal/collection-edit-modal.component.css new file mode 100644 index 0000000..42fcd04 --- /dev/null +++ b/frontend/src/app/features/collections/user-collection-info/collection-edit-modal/collection-edit-modal.component.css @@ -0,0 +1,9 @@ +.rating { + color: var(--shz-gold-1); + font-size: 25px; + margin: 10px 0; +} + +.error-message { + color: var(--shx-red-danger); +} \ No newline at end of file diff --git a/frontend/src/app/features/collections/user-collection-info/collection-edit-modal/collection-edit-modal.component.html b/frontend/src/app/features/collections/user-collection-info/collection-edit-modal/collection-edit-modal.component.html new file mode 100644 index 0000000..8c62745 --- /dev/null +++ b/frontend/src/app/features/collections/user-collection-info/collection-edit-modal/collection-edit-modal.component.html @@ -0,0 +1,47 @@ +
+ +
+
+
+ + +
+ Name is required +
+
+ +
+ + +
+ Description is required +
+
+ +
+ +
+ + +
+
+ +
+ + +
+ + +
+
+ + +
+
+
+
+
\ No newline at end of file diff --git a/frontend/src/app/features/collections/user-collection-info/collection-edit-modal/collection-edit-modal.component.spec.ts b/frontend/src/app/features/collections/user-collection-info/collection-edit-modal/collection-edit-modal.component.spec.ts new file mode 100644 index 0000000..5d424cf --- /dev/null +++ b/frontend/src/app/features/collections/user-collection-info/collection-edit-modal/collection-edit-modal.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CollectionEditModalComponent } from './collection-edit-modal.component'; + +describe('CollectionEditModalComponent', () => { + let component: CollectionEditModalComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [CollectionEditModalComponent] + }) + .compileComponents(); + + fixture = TestBed.createComponent(CollectionEditModalComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/frontend/src/app/features/collections/user-collection-info/collection-edit-modal/collection-edit-modal.component.ts b/frontend/src/app/features/collections/user-collection-info/collection-edit-modal/collection-edit-modal.component.ts new file mode 100644 index 0000000..f8580eb --- /dev/null +++ b/frontend/src/app/features/collections/user-collection-info/collection-edit-modal/collection-edit-modal.component.ts @@ -0,0 +1,98 @@ +import { ChangeDetectorRef, Component, Inject, OnInit } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators } from '@angular/forms'; + +import { + trigger, + state, + style, + transition, + animate, +} from '@angular/animations'; + +@Component({ + selector: 'app-collection-edit-modal', + templateUrl: './collection-edit-modal.component.html', + styleUrl: './collection-edit-modal.component.css', + animations: [ + trigger('fadeInOut', [ + state('in', style({ opacity: 1 })), + transition(':enter', [style({ opacity: 0 }), animate(600)]), + transition(':leave', [animate(600, style({ opacity: 0 }))]), + ]), + trigger('scaleInOut', [ + transition(':enter', [ + state('in', style({ opacity: 1 })), + style({ transform: 'scale(0)' }), + animate('200ms ease-in-out', style({ transform: 'scale(1)' })), + ]), + transition(':leave', [ + animate('200ms ease-in-out', style({ transform: 'scale(0)' })), + ]), + ]), + ], +}) +export class CollectionEditModalComponent implements OnInit { + form!: FormGroup; + + constructor( + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any, + private fb: FormBuilder, + private cd: ChangeDetectorRef + ) {} + + ngOnInit() { + if (this.data == null) return; + this.form = this.fb.group({ + name: [this.data.name, Validators.required], + description: [this.data.description], + user_rating: [this.data.user_rating], + poster: [null], + }); + } + + private markFormGroupTouched(formGroup: FormGroup) { + Object.values(formGroup.controls).forEach((control) => { + control.markAsTouched(); + if (control instanceof FormGroup) { + this.markFormGroupTouched(control); + } + }); + } + + onFileChange(event: any) { + const file = event.target.files[0]; + this.form.patchValue({ poster: file }); + this.form.get('poster')?.updateValueAndValidity(); + } + + onConfirm(): void { + if (this.form.valid) { + let formData = new FormData(); + + formData.append('name', this.form.get('name')?.value); + formData.append('description', this.form.get('description')?.value || ''); + formData.append( + 'user_rating', + this.form.get('user_rating')?.value.toString() + ); + + // Check and append file if it exists + const posterFile = this.form.get('poster')?.value; + if (posterFile) { + formData.append('poster', posterFile); + } + + formData.append('is_poster_link', 'false'); + + this.dialogRef.close({ formData: formData }); + } else { + this.markFormGroupTouched(this.form); + } + } + + onClose(): void { + this.dialogRef.close(); + } +} diff --git a/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.css b/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.css index e69de29..6ae0862 100644 --- a/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.css +++ b/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.css @@ -0,0 +1,5 @@ +.rating { + color: var(--shz-gold-1); + font-size: 25px; + margin: 10px 0; +} \ No newline at end of file diff --git a/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.html b/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.html index bf54c91..4ff9f25 100644 --- a/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.html +++ b/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.html @@ -8,7 +8,7 @@ - + @@ -17,18 +17,24 @@
-
{{list.name}}
-
-
Created - {{createdAt}} | Updated - {{updatedAt}}
-
{{list.description}}
+
Created - {{createdAt}} | Updated - {{updatedAt}} +
+ + +
+
+
{{collection.description}}

- +
\ No newline at end of file diff --git a/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.ts b/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.ts index 2005e49..3a97d5b 100644 --- a/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.ts +++ b/frontend/src/app/features/collections/user-collection-info/userCollection-info-page/userCollection-info-page.component.ts @@ -4,6 +4,8 @@ import { UserCollectionService } from '../../../../core/services/userCollection. import { UserCollection } from '../../../../shared/models/userCollection.model'; import { DatePipe } from '@angular/common'; import { CollectionEntry } from '../../../../shared/models/dtos/collection-entry.dto'; +import { CollectionEditModalComponent } from '../collection-edit-modal/collection-edit-modal.component'; +import { MatDialog } from '@angular/material/dialog'; @Component({ selector: 'app-userCollection-info-page', @@ -12,13 +14,14 @@ import { CollectionEntry } from '../../../../shared/models/dtos/collection-entry providers: [DatePipe], }) export class UserCollectionInfoPageComponent implements OnInit { - list: UserCollection = {} as UserCollection; + collection: UserCollection = {} as UserCollection; createdAt: string = ''; updatedAt: string = ''; constructor( private route: ActivatedRoute, - private listService: UserCollectionService, + private userCollectionService: UserCollectionService, + public dialog: MatDialog, private datePipe: DatePipe ) {} @@ -26,14 +29,17 @@ export class UserCollectionInfoPageComponent implements OnInit { const id = this.route.snapshot.paramMap.get('id'); if (id == null) return; - this.listService.getCollection(id.toString()).subscribe( + this.userCollectionService.getCollection(id.toString()).subscribe( (data) => { - this.list = data as unknown as UserCollection; - this.list.entries = this.list.entries as CollectionEntry[]; + this.collection = data as unknown as UserCollection; + this.collection.entries = this.collection.entries as CollectionEntry[]; this.createdAt = this.getCreatedDate()?.toString() || ''; this.updatedAt = this.getUpdatedAt()?.toString() || ''; - console.log(`Collection "${this.list.name}" received:`, this.list); + console.log( + `Collection "${this.collection.name}" received:`, + this.collection + ); }, (error) => { console.error('Error occurred:', error); @@ -42,16 +48,16 @@ export class UserCollectionInfoPageComponent implements OnInit { } getListId() { - return this.list.id + ''; + return this.collection.id + ''; } getCreatedDate() { - return this.datePipe.transform(this.list.createdAt, 'dd MMMM, yyyy'); + return this.datePipe.transform(this.collection.createdAt, 'dd MMMM, yyyy'); } // TODO use a relativeDate pipe getUpdatedAt() { - const updatedAt = this.list.updatedAt; + const updatedAt = this.collection.updatedAt; // First, check if updatedAt is a valid date string or timestamp const modifiedDate = new Date(updatedAt); @@ -87,4 +93,45 @@ export class UserCollectionInfoPageComponent implements OnInit { return this.datePipe.transform(modifiedDate, 'dd MMMM, yyyy'); } } + + openEditModal() { + if (!this.collection) return; + + const dialogRef = this.dialog.open(CollectionEditModalComponent, { + width: '360px', + data: { + name: this.collection.name, + description: this.collection.description, + user_rating: this.collection.user_rating || 0, + poster: this.collection.poster_path, + }, + }); + + console.log('Edit dialog opened'); + + dialogRef.afterClosed().subscribe((result) => { + if (result) { + if (result.formData == null) return; + console.log('Edit dialog closed with:', result); + + this.userCollectionService + .updateCollection(this.collection.id, result.formData) + .subscribe({ + next: (userCollection) => { + if (userCollection) { + // TODO show confirm notification + console.log(`User Collection updated: `, userCollection); + this.collection = userCollection; + } + }, + error: (error) => { + console.error('Error updating userCollection:', error); + // TODO show notification + }, + }); + } else { + console.log('Edit dialog was cancelled'); + } + }); + } } diff --git a/frontend/src/app/features/collections/user-collections.module.ts b/frontend/src/app/features/collections/user-collections.module.ts index 57f0b64..88c6017 100644 --- a/frontend/src/app/features/collections/user-collections.module.ts +++ b/frontend/src/app/features/collections/user-collections.module.ts @@ -1,33 +1,41 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { AppRoutingModule } from '../../app-routing.module'; -import { CollectionsRoutingModule } from './collections-routing.module'; import { SharedModule } from '../../shared/shared.module'; +import { CollectionsRoutingModule } from './collections-routing.module'; + +import { DragDropModule } from '@angular/cdk/drag-drop'; + import { UserCollectionsPageComponent } from './user-collections/userCollections-page/userCollections-page.component'; import { UserCollectionsListItemComponent } from './user-collections/userCollection-list-item/userCollections-list-item.component'; import { UserCollectionEntryGridComponent } from './user-collection-info/userCollection-entry-grid/userCollection-entry-grid.component'; import { UserCollectionGridCardComponent } from './user-collection-info/userCollection-grid-card/userCollection-grid-card.component'; import { UserCollectionInfoPageComponent } from './user-collection-info/userCollection-info-page/userCollection-info-page.component'; +import { UserCollectionsModalComponent } from '../../shared/components/modals/list-selection-modal/user-collections-modal.component'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { DragDropModule } from '@angular/cdk/drag-drop'; @NgModule({ - declarations: [ - UserCollectionEntryGridComponent, - UserCollectionGridCardComponent, - UserCollectionInfoPageComponent, - - UserCollectionsPageComponent, - UserCollectionsListItemComponent, - ], imports: [ CommonModule, SharedModule, - CollectionsRoutingModule, + FormsModule, ReactiveFormsModule, + + CollectionsRoutingModule, + DragDropModule, ], + declarations: [ + // collections list page + UserCollectionsPageComponent, + UserCollectionsListItemComponent, + + // collection info page + UserCollectionInfoPageComponent, + UserCollectionEntryGridComponent, + UserCollectionGridCardComponent, + UserCollectionsModalComponent, + ], exports: [], }) export class UserCollectionsModule {} diff --git a/frontend/src/app/features/collections/user-collections/userCollection-list-item/userCollections-list-item.component.ts b/frontend/src/app/features/collections/user-collections/userCollection-list-item/userCollections-list-item.component.ts index 2c358d0..eb40340 100644 --- a/frontend/src/app/features/collections/user-collections/userCollection-list-item/userCollections-list-item.component.ts +++ b/frontend/src/app/features/collections/user-collections/userCollection-list-item/userCollections-list-item.component.ts @@ -32,8 +32,13 @@ export class UserCollectionsListItemComponent { getPostPath() { if (this.list.poster_path == null) return 'https://pic.pnnet.dev/256x256'; + if (this.list.poster_path.startsWith('/')) + return `https://image.tmdb.org/t/p/w500` + this.list.poster_path; - return `https://image.tmdb.org/t/p/w500` + this.list.poster_path; + return ( + `http://localhost:4000/api/v1/media/collections/posters/` + + this.list.poster_path + ); } getCreatedDate(): string { diff --git a/frontend/src/app/shared/components/modals/list-selection-modal/user-collections-modal.component.ts b/frontend/src/app/shared/components/modals/list-selection-modal/user-collections-modal.component.ts index cfb268e..0fbdaf0 100644 --- a/frontend/src/app/shared/components/modals/list-selection-modal/user-collections-modal.component.ts +++ b/frontend/src/app/shared/components/modals/list-selection-modal/user-collections-modal.component.ts @@ -124,7 +124,10 @@ export class UserCollectionsModalComponent implements OnInit { `Adding Entry ${this.entryId} to list: ${userCollection.name}` ); this.listService - .addEntryToCollection(userCollection.id, this.entryId) + .addEntryToCollection( + userCollection.id, + this.entryId + ) .subscribe({ next: (response) => { console.log('Successfuly added Entry To Collection:', response); diff --git a/frontend/src/app/shared/shared.module.ts b/frontend/src/app/shared/shared.module.ts index aa0fb8b..906ae03 100644 --- a/frontend/src/app/shared/shared.module.ts +++ b/frontend/src/app/shared/shared.module.ts @@ -1,6 +1,5 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; // * cards import { SeasonMainCardComponent } from './cards/season-main-card/season-main-card.component'; @@ -13,15 +12,26 @@ import { DateFormatPipe } from './pipes/date-format/date-format.pipe'; // * other import { RatingModule } from 'ngx-bootstrap/rating'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { CollectionEditModalComponent } from '../features/collections/user-collection-info/collection-edit-modal/collection-edit-modal.component'; @NgModule({ + imports: [ + CommonModule, + + FormsModule, + ReactiveFormsModule, + + RatingModule.forRoot(), + ], declarations: [ - // ? pipes + // * pipes DateFormatPipe, // ? components SeasonMainCardComponent, SeenModalComponent, + CollectionEditModalComponent // ? other imported components @@ -33,18 +43,17 @@ import { RatingModule } from 'ngx-bootstrap/rating'; // ? modules ], - imports: [ - CommonModule, + exports: [ + // * pipes + DateFormatPipe, + FormsModule, ReactiveFormsModule, - - RatingModule.forRoot(), - ], - exports: [ + //NotificationPopupComponent, - DateFormatPipe, SeasonMainCardComponent, SeenModalComponent, + RatingModule, ], }) diff --git a/package-lock.json b/package-lock.json index 704bf69..899ef31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "date-fns": "^3.6.0", "express": "^4.19.2", "flatpickr": "^4.6.13", + "multer": "^1.4.5-lts.1", "mysql2": "^3.9.3", "ngx-bootstrap": "^12.0.0", "rxjs": "~7.8.0", @@ -5956,6 +5957,11 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "node_modules/append-field": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", + "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==" + }, "node_modules/archiver": { "version": "5.3.2", "resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.2.tgz", @@ -6967,8 +6973,7 @@ "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, "node_modules/builder-util": { "version": "24.13.1", @@ -7164,6 +7169,17 @@ "semver": "^7.0.0" } }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -7733,6 +7749,47 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "engines": [ + "node >= 0.8" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/concat-stream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/concat-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/concat-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/concurrently": { "version": "8.2.2", "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-8.2.2.tgz", @@ -8191,8 +8248,7 @@ "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/cors": { "version": "2.8.5", @@ -11335,8 +11391,7 @@ "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" }, "node_modules/isbinaryfile": { "version": "4.0.10", @@ -12735,7 +12790,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -12955,7 +13009,6 @@ "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, "dependencies": { "minimist": "^1.2.6" }, @@ -12996,6 +13049,23 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, + "node_modules/multer": { + "version": "1.4.5-lts.1", + "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.1.tgz", + "integrity": "sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==", + "dependencies": { + "append-field": "^1.0.0", + "busboy": "^1.0.0", + "concat-stream": "^1.5.2", + "mkdirp": "^0.5.4", + "object-assign": "^4.1.1", + "type-is": "^1.6.4", + "xtend": "^4.0.0" + }, + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/multicast-dns": { "version": "7.2.5", "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz", @@ -13565,7 +13635,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -14397,8 +14466,7 @@ "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "node_modules/progress": { "version": "2.0.3", @@ -16085,6 +16153,14 @@ "node": ">=8.0" } }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -16740,6 +16816,11 @@ "integrity": "sha512-KNNZtayBCtmnNmbo5mG47p1XsCyrx6iVqomjcZnec/1Y5GGARaxPs6r49RnSPeUP3YjNYiU9sQHAtY4BBvnZwg==", "dev": true }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" + }, "node_modules/typescript": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", @@ -16937,8 +17018,7 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/utils-merge": { "version": "1.0.1", @@ -17981,7 +18061,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true, "engines": { "node": ">=0.4" } diff --git a/package.json b/package.json index 4c5c400..fb51d9a 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "date-fns": "^3.6.0", "express": "^4.19.2", "flatpickr": "^4.6.13", + "multer": "^1.4.5-lts.1", "mysql2": "^3.9.3", "ngx-bootstrap": "^12.0.0", "rxjs": "~7.8.0",