shuttlepro-shared 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -161,7 +161,7 @@ const createLabelRepository = (dependencies) => {
|
|
|
161
161
|
// Functional CRUD Operations
|
|
162
162
|
const createLabel = async (labelData) => {
|
|
163
163
|
// Compose validation and creation
|
|
164
|
-
const create = R.
|
|
164
|
+
const create = R.pipe(
|
|
165
165
|
(label) => label.save(),
|
|
166
166
|
validateLabel(await Label.find()),
|
|
167
167
|
Label.hydrate
|
|
@@ -180,7 +180,7 @@ const createLabelRepository = (dependencies) => {
|
|
|
180
180
|
} = options;
|
|
181
181
|
|
|
182
182
|
// Compose query construction and execution
|
|
183
|
-
const executeQuery = R.
|
|
183
|
+
const executeQuery = R.pipe(
|
|
184
184
|
R.when(R.always(lean), R.map(R.prop("toObject"))),
|
|
185
185
|
(labels) => (populate.length ? Label.populate(labels, populate) : labels),
|
|
186
186
|
(labels) => R.take(limit, labels),
|
|
@@ -200,7 +200,7 @@ const createLabelRepository = (dependencies) => {
|
|
|
200
200
|
|
|
201
201
|
// Functional update with immutable updates
|
|
202
202
|
const updateLabel = R.curry(async (labelId, updateData) => {
|
|
203
|
-
const update = R.
|
|
203
|
+
const update = R.pipe(
|
|
204
204
|
R.tap(async (updatedLabel) => {
|
|
205
205
|
// Update cache atomically
|
|
206
206
|
await setRedisData(
|
|
@@ -222,7 +222,7 @@ const createLabelRepository = (dependencies) => {
|
|
|
222
222
|
|
|
223
223
|
// Functional delete with side effect management
|
|
224
224
|
const deleteLabel = async (labelId) => {
|
|
225
|
-
const performDelete = R.
|
|
225
|
+
const performDelete = R.pipe(
|
|
226
226
|
R.tap(async () => {
|
|
227
227
|
// Clear all related caches
|
|
228
228
|
await deleteRedisData(redisConfig.cache.keys.LABEL_DETAILS(labelId));
|