Skip to content

Commit 28771ad

Browse files
committed
search does not show deleted files anymore
1 parent d8285c3 commit 28771ad

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

service/src/data-access/FilesController.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,19 @@ export class FilesController
184184

185185
const filesTable = builder.SetPrimaryTable("files");
186186

187+
const filesDeletedTable = builder.AddJoin({
188+
type: "LEFT",
189+
tableName: "files_deleted",
190+
conditions: [
191+
{
192+
column: "fileId",
193+
operator: "=",
194+
joinTable: filesTable,
195+
joinTableColumn: "id"
196+
}
197+
]
198+
});
199+
187200
builder.AddCondition({
188201
combination: "AND",
189202
conditions: [
@@ -207,6 +220,11 @@ export class FilesController
207220
operator: "LIKE",
208221
constant: "%" + mediaTypeFilter + "%"
209222
},
223+
{
224+
operand: { table: filesDeletedTable, column: "deletionTime" },
225+
operator: "IS",
226+
constant: null
227+
}
210228
]
211229
});
212230
builder.SetColumns([

0 commit comments

Comments
 (0)