Link articlehistory to companyuser; store Google picture and sub on google_auth
This commit is contained in:
@@ -14,6 +14,7 @@ export default function getHistoryBySku(pool) {
|
||||
|
||||
return result.recordset.map((row) => ({
|
||||
id: row.id,
|
||||
companyuserId: row.companyuserId ?? null,
|
||||
date: row.date,
|
||||
text: row.text,
|
||||
}));
|
||||
|
||||
@@ -26,6 +26,7 @@ export default function resolveArticleBySku(pool) {
|
||||
companyId: row.companyId,
|
||||
rootCategoryId: row.rootCategoryId,
|
||||
posCustomerGroupId: row.posCustomerGroupId ?? null,
|
||||
companyuserId: row.companyuserId,
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -41,7 +41,10 @@ export default function updateBySku(pool) {
|
||||
throw new Error('Invalid unitamount');
|
||||
}
|
||||
|
||||
const { articleId, languageId, companyId } = await resolve(googleAuthId, sku);
|
||||
const { articleId, languageId, companyId, companyuserId } = await resolve(
|
||||
googleAuthId,
|
||||
sku,
|
||||
);
|
||||
|
||||
const currentResult = await pool
|
||||
.request()
|
||||
@@ -134,6 +137,7 @@ export default function updateBySku(pool) {
|
||||
if (historyLines.length) {
|
||||
await request(pool, tx)
|
||||
.input('articleId', articleId)
|
||||
.input('companyuserId', companyuserId)
|
||||
.input('text', historyLines.join('\n'))
|
||||
.query(INSERT_HISTORY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user