Skip to content

Commit

Permalink
feat: upload binary offer file
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelTaylor3D committed Sep 7, 2022
1 parent 62bc784 commit 862c23b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/controllers/offer.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,16 @@ export const importOfferFile = async (req, res) => {
await assertNoPendingCommits();
await assertNoActiveOfferFile();

const offerFile = req.body;
const offerFileBuffer = req.files.file.data;
const offerFile = offerFileBuffer.toString('utf-8');

// await datalayer.verifyOffer(offerFile);
await datalayer.verifyOffer(offerFile);

await Meta.upsert({
metaKey: 'activeOffer',
metaValue: JSON.stringify(offerFile),
});

// const makerChanges = deserializeMaker(offerFile.maker);
// const takerChanges = deserializeTaker(offerFile.taker);

res.json({
message: 'Offer has been imported for review.',
});
Expand Down

0 comments on commit 862c23b

Please sign in to comment.