Skip to content

Commit

Permalink
[cascading] from release/10.3.0-rc to main (#1754)
Browse files Browse the repository at this point in the history
<!--
{"currentBranch":"release/10.3.0-rc","targetBranch":"main","bypassReviewers":true,"isConflicting":false}
-->

## Cascading from release/10.3.0-rc to main

The configuration requests the cascading to bypass reviewer in case of
CI success.
To not bypass the reviewing process, please check the following
checkbox:

- [ ] <!-- !cancel bypass! --> 🚫 stop reviewing process
bypass for this Pull Request

---

<small>This Pull Request has been generated with ❤️ by the
[Otter](https://github.com/AmadeusITGroup/otter) cascading tool.</small>
  • Loading branch information
kpanot committed May 7, 2024
2 parents 23f4c72 + 8b0ac94 commit bc5bc2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions packages/@o3r/core/src/store/async/async-entity.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface EntityAsyncRequestAdapter<T extends AsyncStoreItem> extends Ent
* @param ids Ids of the entity to be updated with AsyncStoreItem properties
* @param requestId Id of request which has failed
*/
failRequestMany<V extends EntityState<T> & AsyncStoreItem>(state: V, ids?: string[] | number[], requestId?: string): V;
failRequestMany<V extends EntityState<T> & AsyncStoreItem>(state: V, ids?: (string | number)[], requestId?: string): V;

/**
* Adds AsyncStoreItem property to the global store, or the entity if it already exists, when a request is triggered.
Expand All @@ -27,7 +27,7 @@ export interface EntityAsyncRequestAdapter<T extends AsyncStoreItem> extends Ent
* @param ids Ids of the entity to be updated with AsyncStoreItem properties
* @param requestId Id of request which is triggered
*/
addRequestMany<V extends EntityState<T>>(state: V, ids: string[] | number[], requestId: string): V;
addRequestMany<V extends EntityState<T>>(state: V, ids: (string | number)[], requestId: string): V;

/**
* Updates the state with the given entity. Update the global or the current entity's status if it exists.
Expand Down Expand Up @@ -79,8 +79,8 @@ export function createEntityAsyncRequestAdapter<T extends AsyncStoreItem>(adapte
return asyncStoreItemAdapter.addRequest(state, requestId);
};

const addRequestMany: <V extends EntityState<T>>(state: V, ids: string[], requestId: string) => V =
<V extends EntityState<T>>(state: V, ids: string[], requestId: string): V =>
const addRequestMany: <V extends EntityState<T>>(state: V, ids: (string | number)[], requestId: string) => V =
<V extends EntityState<T>>(state: V, ids: (string | number)[], requestId: string): V =>
adapter.updateMany(ids.filter((id) => !!state.entities[id]).map((id) => ({
id,
changes: asyncStoreItemAdapter.addRequest(asyncStoreItemAdapter.extractAsyncStoreItem(state.entities[id]!), requestId)
Expand Down Expand Up @@ -113,8 +113,8 @@ export function createEntityAsyncRequestAdapter<T extends AsyncStoreItem>(adapte
}
), state);

const failRequestMany: <V extends EntityState<T> & AsyncStoreItem>(state: V, ids?: string[] | number[], requestId?: string) => V =
<V extends EntityState<T> & AsyncStoreItem>(state: V, ids: string[] | number[] = [], requestId?: string): V => {
const failRequestMany: <V extends EntityState<T> & AsyncStoreItem>(state: V, ids?: (string | number)[], requestId?: string) => V =
<V extends EntityState<T> & AsyncStoreItem>(state: V, ids: (string | number)[] = [], requestId?: string): V => {
if (ids.length && !ids.some((id) => state.entities[id] === undefined)) {
return adapter.updateMany(ids.map((id) => ({
id,
Expand Down
2 changes: 1 addition & 1 deletion packages/@o3r/core/src/store/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export interface SetEntityActionPayload<T> {

/** Payload to fail entities actions */
export interface FailEntitiesActionPayload<T> extends FailActionPayload<T> {
ids?: string[] | number[];
ids?: (string | number)[];
}

/**
Expand Down

0 comments on commit bc5bc2c

Please sign in to comment.