Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@brightspace-hmc/siren-sdk

Package Overview
Dependencies
Maintainers
2
Versions
187
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brightspace-hmc/siren-sdk - npm Package Compare versions

Comparing version 2.40.0 to 2.41.0

2

package.json
{
"name": "@brightspace-hmc/siren-sdk",
"version": "2.40.0",
"version": "2.41.0",
"type": "module",

@@ -5,0 +5,0 @@ "description": "",

@@ -125,2 +125,15 @@ import { Actions, Classes } from '../hypermedia-constants.js';

_generateDeletePreviousAndAssociateWithNewCategory(category, shouldDeletePreviousCategory) {
const categoryEntity = this._getCategoryById(category.categoryId);
if (!categoryEntity) return;
const action = shouldDeletePreviousCategory && categoryEntity.getActionByName(Actions.activities.categories.deletePreviousAndAssociateWithNewCategory);
if (!action) return;
const fields = [
{ name: 'deletePreviousCategory', value: shouldDeletePreviousCategory }
];
return { action, fields };
}
_hasCategoryIdChanged(categoryId) {

@@ -133,7 +146,9 @@ const selectedCategory = this.getSelectedCategory();

async save(category) {
async save(category, shouldDeletePreviousCategory = false) {
const hasCategoryIdChanged = category.categoryId && this._hasCategoryIdChanged(category.categoryId);
if (hasCategoryIdChanged && category.categoryId !== UNSET_CATEGORY_ID) {
const { action, fields } = this._generateSelectCategoryAction(category) || {};
const { action, fields } = shouldDeletePreviousCategory
? this._generateDeletePreviousAndAssociateWithNewCategory(category, shouldDeletePreviousCategory) || {}
: this._generateSelectCategoryAction(category) || {};

@@ -140,0 +155,0 @@ return action && await performSirenAction(this._token, action, fields);

@@ -583,3 +583,4 @@ export const Rels = {

deselect: 'deselect',
add: 'add'
add: 'add',
deletePreviousAndAssociateWithNewCategory: 'delete-previous-and-associate-with-new-category',
},

@@ -586,0 +587,0 @@ create: 'create',

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc