Skip to content

Commit

Permalink
fix: improves typing in delete op
Browse files Browse the repository at this point in the history
  • Loading branch information
jmikrut committed Jan 6, 2021
1 parent 2aab4df commit 644519c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/collections/operations/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import fileExists from '../../uploads/fileExists';
import { BeforeOperationHook, Collection } from '../config/types';
import { Document, Where } from '../../types';
import { hasWhereAccessResult } from '../../auth/types';
import { FileSize } from '../../uploads/types';
import { FileData } from '../../uploads/types';

export type Arguments = {
depth?: number
Expand Down Expand Up @@ -119,7 +119,7 @@ async function deleteQuery(incomingArgs: Arguments): Promise<Document> {
}

if (resultToDelete.sizes) {
Object.values(resultToDelete.sizes).forEach(async (size: FileSize) => {
Object.values(resultToDelete.sizes).forEach(async (size: FileData) => {
if (await fileExists(`${staticPath}/${size.filename}`)) {
fs.unlink(`${staticPath}/${size.filename}`, (err) => {
if (err) {
Expand Down

0 comments on commit 644519c

Please sign in to comment.