Feat/note on order (#399)

* added NoteService and related endpoints && tests

* removed snapshots

* corrected error in service

* removed snapshot

* added the ability to note down author using a string

* updated model for note

* refactored to access logged in user

* added other user id option

* removed snapshot

* updated according to feedback

* removed snapshots

* reintroduced snapshots

* updated to snake case

* removed try catch from use-db
This commit is contained in:
Sebastian Mateos Nicolajsen
2021-09-22 15:19:35 +02:00
committed by GitHub
parent a82332da3e
commit 897ccf475a
18 changed files with 1054 additions and 46 deletions

View File

@@ -1,11 +1,11 @@
const Scrypt = require("scrypt-kdf");
const { User } = require("@medusajs/medusa");
const Scrypt = require("scrypt-kdf")
const { User } = require("@medusajs/medusa")
module.exports = async (connection, data = {}) => {
const manager = connection.manager;
const manager = connection.manager
const buf = await Scrypt.kdf("secret_password", { logN: 1, r: 1, p: 1 });
const password_hash = buf.toString("base64");
const buf = await Scrypt.kdf("secret_password", { logN: 1, r: 1, p: 1 })
const password_hash = buf.toString("base64")
await manager.insert(User, {
id: "admin_user",
@@ -13,5 +13,5 @@ module.exports = async (connection, data = {}) => {
api_token: "test_token",
password_hash,
...data,
});
};
})
}