Skip to content

Commit

Permalink
add color default
Browse files Browse the repository at this point in the history
  • Loading branch information
xsalonx committed Mar 7, 2024
1 parent 73ee5dc commit e96370f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/server/services/qualityControlFlag/QCFlagTypesService.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ const { NotFoundError } = require('../../errors/NotFoundError');
const { getUserOrFail } = require('../user/getUserOrFail');
const { ConflictError } = require('../../errors/ConflictError');

const DEFAULT_BAD_FLAG_COLOR = '#d62631';
const DEFAULT_NOT_BAD_FLAG_COLOR = '#4caf50';

/**
* @typedef QCFlagTypeIdentifier
* @param {number} id
Expand Down Expand Up @@ -96,7 +99,7 @@ class QCFlagTypesService {
name,
method,
bad,
color,
color: color ?? bad ? DEFAULT_BAD_FLAG_COLOR : DEFAULT_NOT_BAD_FLAG_COLOR,
createdById: user.id,
});
return qcFlagTypeAdapter.toEntity(await this.getByIdentifier({ id: newFlagInstance.id }));
Expand Down

0 comments on commit e96370f

Please sign in to comment.