-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename public uploads to file uploads
The name "public uploads" was not fitting since the uploads can also be used for "private" uploads in the Admin. The feature was therefore renamed to "file uploads". This requires the following changes: - Use `FilesUploadModule` instead of `PublicUploadModule` - Use `FileUpload` instead of `PublicUpload` - Use `FileUploadsService` instead of `PublicUploadsService` - Change the upload URL from `/public-upload/files/upload` to `/files-uploads/upload`
- Loading branch information
1 parent
34ae666
commit 5211402
Showing
32 changed files
with
304 additions
and
228 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@comet/cms-api": major | ||
--- | ||
|
||
Remove `download` helper | ||
|
||
Use `createFileUploadInputFromUrl` instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@comet/cms-api": major | ||
--- | ||
|
||
Remove `FileUploadService` | ||
|
||
Use `createFileUploadInputFromUrl` instead of `FileUploadService#createFileUploadInputFromUrl`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
"@comet/cms-api": major | ||
--- | ||
|
||
Rename public uploads to file uploads | ||
|
||
The name "public uploads" was not fitting since the uploads can also be used for "private" uploads in the Admin. | ||
The feature was therefore renamed to "file uploads". | ||
|
||
This requires the following changes: | ||
|
||
- Use `FilesUploadModule` instead of `PublicUploadModule` | ||
- Use `FileUpload` instead of `PublicUpload` | ||
- Use `FileUploadsService` instead of `PublicUploadsService` | ||
- Change the upload URL from `/public-upload/files/upload` to `/files-uploads/upload` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"publicUploads": { | ||
"fileUploads": { | ||
"maxFileSize": 15 | ||
}, | ||
"imgproxy": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
demo/api/src/db/fixtures/generators/file-uploads-fixture.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { createFileUploadInputFromUrl, FileUpload, FileUploadsService } from "@comet/cms-api"; | ||
import { Injectable } from "@nestjs/common"; | ||
import path from "path"; | ||
|
||
@Injectable() | ||
export class FileUploadsFixtureService { | ||
constructor(private readonly fileUploadsService: FileUploadsService) {} | ||
|
||
async generateFileUploads(): Promise<FileUpload[]> { | ||
console.log("Generating file uploads..."); | ||
|
||
const images = ["01.jpg", "02.jpg", "03.jpg", "04.jpg", "05.jpg"]; | ||
const fileUploads: FileUpload[] = []; | ||
|
||
for (const image of images) { | ||
const file = await createFileUploadInputFromUrl(path.resolve(`./src/db/fixtures/generators/images/${image}`)); | ||
fileUploads.push(await this.fileUploadsService.upload(file)); | ||
} | ||
|
||
return fileUploads; | ||
} | ||
} |
22 changes: 0 additions & 22 deletions
22
demo/api/src/db/fixtures/generators/public-uploads-fixture.service.ts
This file was deleted.
Oops, something went wrong.
8 changes: 3 additions & 5 deletions
8
demo/api/src/db/fixtures/generators/svg-image-file-fixture.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.