refs #4975 MdbVersion/upload fixes & code clean
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
afef2e4d63
commit
9336d20e45
|
@ -47,7 +47,16 @@ module.exports = Self => {
|
|||
verb: 'POST'
|
||||
}
|
||||
});
|
||||
Self.upload = async(ctx, options) => {
|
||||
Self.upload = async(
|
||||
ctx,
|
||||
options,
|
||||
appName,
|
||||
toVersion,
|
||||
branch,
|
||||
fromVersion,
|
||||
description,
|
||||
unlock
|
||||
) => {
|
||||
const models = Self.app.models;
|
||||
const myOptions = {};
|
||||
const $t = ctx.req.__; // $translate
|
||||
|
@ -55,12 +64,6 @@ module.exports = Self => {
|
|||
const AccessContainer = models.AccessContainer;
|
||||
const fileOptions = {};
|
||||
let tx;
|
||||
const appName = ctx.args.appName;
|
||||
const toVersion = ctx.args.toVersion;
|
||||
const branch = ctx.args.branch;
|
||||
const fromVersion = ctx.args.fromVersion;
|
||||
let description = ctx.args.description;
|
||||
const unlock = ctx.args.unlock;
|
||||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
@ -153,11 +156,14 @@ module.exports = Self => {
|
|||
formatDesc += `*${appName.toUpperCase()}* v.${toVersion} `;
|
||||
|
||||
const oldVersion = await models.MdbVersionTree.findOne({
|
||||
where: {version: fromVersion},
|
||||
where: {
|
||||
version: fromVersion,
|
||||
app: appName
|
||||
},
|
||||
fields: ['branchFk']
|
||||
}, myOptions);
|
||||
|
||||
if (branch == oldVersion.branchFk)
|
||||
if (!oldVersion || branch == oldVersion.branchFk)
|
||||
formatDesc += `[*${branch}*]: `;
|
||||
else
|
||||
formatDesc += `[*${oldVersion.branchFk}* » *${branch}*]: `;
|
||||
|
|
Loading…
Reference in New Issue