Postgres.
This commit is contained in:
parent
695644c260
commit
806f42e3f8
25 changed files with 501 additions and 294 deletions
|
@ -1,3 +1,5 @@
|
|||
import models from '../models';
|
||||
|
||||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
|
||||
function randomID() {
|
||||
|
@ -12,7 +14,7 @@ function* checkId(Files, fileId, attempts) {
|
|||
if (attempts > 10) {
|
||||
return false;
|
||||
}
|
||||
const file = yield Files.findOne({ _id: fileId });
|
||||
const file = yield models.file.findById(fileId);
|
||||
if (file === null) {
|
||||
return fileId;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue