-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathPublishCollection.ts
More file actions
20 lines (17 loc) · 910 Bytes
/
PublishCollection.ts
File metadata and controls
20 lines (17 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { UseCase } from '../../../core/domain/useCases/UseCase'
import { ICollectionsRepository } from '../repositories/ICollectionsRepository' // Assuming Axios for HTTP requests
export class PublishCollection implements UseCase<void> {
private collectionsRepository: ICollectionsRepository
constructor(collectionsRepository: ICollectionsRepository) {
this.collectionsRepository = collectionsRepository
}
/**
* Publishes a collection, given its identifier.
*
* @param {number | string} [collectionIdOrAlias] - The collection identifier, which can be a string (for collection alias), or a number (for numeric identifiers).
* @returns {Promise<void>} - This method does not return anything upon successful completion.
*/
async execute(collectionIdOrAlias: number | string): Promise<void> {
return await this.collectionsRepository.publishCollection(collectionIdOrAlias)
}
}