Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(lr-upload-ctx-provider): add method removeFileByInternalId #618

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions abstract/UploaderBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { TypedCollection } from './TypedCollection.js';
import { buildOutputCollectionState } from './buildOutputCollectionState.js';
import { uploadEntrySchema } from './uploadEntrySchema.js';
import { throttle } from '../blocks/utils/throttle.js';

Check warning on line 23 in abstract/UploaderBlock.js

View workflow job for this annotation

GitHub Actions / build

'throttle' is defined but never used

export class UploaderBlock extends ActivityBlock {
couldBeCtxOwner = false;
Expand Down Expand Up @@ -260,6 +260,14 @@
});
}

/** @param {string} internalId */
removeFileByInternalId(internalId) {
if (!this.uploadCollection.read(internalId)) {
throw new Error(`File with internalId ${internalId} not found`);
}
this.uploadCollection.remove(internalId);
}

uploadAll = () => {
const itemsToUpload = this.uploadCollection.items().filter((id) => {
const entry = this.uploadCollection.read(id);
Expand Down
Loading