diff --git a/src/ws/crud.js b/src/ws/crud.js index 8356509..aa7381d 100644 --- a/src/ws/crud.js +++ b/src/ws/crud.js @@ -22,10 +22,7 @@ const eventFns = { create: async (data) => { try { const ev = new events(data) - ev.save((err) => { - if (err) - console.warn(err) - }) + await ev.save(); } catch (e) { console.warn(e) } @@ -48,10 +45,7 @@ const rosterFns = { create: async (data) => { try { const ev = new rosters(data) - ev.save((err) => { - if (err) - console.warn(err) - }) + await ev.save(); } catch (e) { console.warn(e) } @@ -74,10 +68,7 @@ const matchFns = { create: async (data) => { try { const ev = new matches(data) - ev.save((err) => { - if (err) - console.warn(err) - }) + await ev.save(); } catch (e) { console.warn(e) } @@ -109,10 +100,7 @@ const streamFns = { create: async (data) => { try { const ev = new streams(data) - ev.save((err) => { - if (err) - console.warn(err) - }) + await ev.save(); } catch (e) { console.warn(e) } @@ -135,10 +123,7 @@ const casterFns = { create: async (data) => { try { const ev = new casters(data) - ev.save((err) => { - if (err) - console.warn(err) - }) + await ev.save(); } catch (e) { console.warn(e) } @@ -161,10 +146,7 @@ const hostFns = { create: async (data) => { try { const ev = new hosts(data) - ev.save((err) => { - if (err) - console.warn(err) - }) + await ev.save(); } catch (e) { console.warn(e) } @@ -196,10 +178,7 @@ const bracketFns = { create: async (data) => { try { const ev = new brackets(data) - ev.save((err) => { - if (err) - console.warn(err) - }) + await ev.save(); } catch (e) { console.warn(e) } @@ -214,4 +193,4 @@ module.exports = { 'casters': casterFns, 'hosts': hostFns, 'brackets': bracketFns, -} \ No newline at end of file +}