Skip to content

Commit

Permalink
Add crop mode for thumbnails.
Browse files Browse the repository at this point in the history
  • Loading branch information
mitkonikov committed Feb 12, 2024
1 parent a4795cd commit f30f6b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions backend/src/models/thumbnail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import mongoose from 'mongoose';
export interface IThumbnail extends Document {
title: string;
filepath: string;
crop: boolean;
}

const schema = new mongoose.Schema<IThumbnail>({
title: String,
filepath: String,
crop: Boolean,
});

const Thumbnail = mongoose.model('Thumbnail', schema);
Expand Down
8 changes: 7 additions & 1 deletion backend/src/resources/thumbnail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ import UploadProvider from '../admin/upload-provider.js';

export const thumbnails = {
resource: Thumbnail,
options: {},
options: {
properties: {
crop: {
type: 'boolean',
},
},
},
features: [
uploadFeature({
componentLoader,
Expand Down

0 comments on commit f30f6b0

Please sign in to comment.