Skip to content

Commit c7773f3

Browse files
committed
fix(ts): add missing change to mongo/pushes
1 parent 3e8793f commit c7773f3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/db/mongo/pushes.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { connect, findDocuments, findOneDocument } from './helper';
22
import { Action } from '../../proxy/actions';
33
import { toClass } from '../helper';
4-
import * as repo from './repo';
4+
import * as repo from './repo';
55
import { Push, PushQuery } from '../types';
66

77
const collectionName = 'pushes';
@@ -52,6 +52,9 @@ export const writeAudit = async (action: Action): Promise<Action> => {
5252
const options = { upsert: true };
5353
const collection = await connect(collectionName);
5454
delete data._id;
55+
if (typeof data.id !== 'string') {
56+
throw new Error('Invalid id');
57+
}
5558
await collection.updateOne({ id: data.id }, { $set: data }, options);
5659
return action;
5760
};

0 commit comments

Comments
 (0)