Skip to content

Commit e61638a

Browse files
committed
feat(hub-common): fix cyclical module dependency introduced on this PR
affects: @esri/hub-common ISSUES CLOSED: 12495
1 parent 7f3b5e6 commit e61638a

File tree

2 files changed

+75
-75
lines changed

2 files changed

+75
-75
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,74 +1 @@
1-
import {
2-
discussionsApiRequest,
3-
discussionsApiRequestV2,
4-
} from "../discussions-api-request";
5-
import {
6-
ICreateReactionOptions,
7-
IRemoveReactionOptions,
8-
IRemoveReactionResponse,
9-
IReaction,
10-
} from "../types";
11-
12-
/**
13-
* create reaction to post
14-
*
15-
* @deprecated use createReactionV2 instead
16-
* @export
17-
* @param {ICreateReactionOptions} options
18-
* @return {*} {Promise<IReaction>}
19-
*/
20-
export function createReaction(
21-
options: ICreateReactionOptions
22-
): Promise<IReaction> {
23-
options.httpMethod = "POST";
24-
return discussionsApiRequest(`/reactions`, options);
25-
}
26-
27-
/**
28-
* remove reaction
29-
*
30-
* @deprecated use removeReactionV2 instead
31-
* @export
32-
* @param {IRemoveReactionOptions} options
33-
* @return {*} {Promise<IRemoveReactionResponse>}
34-
*/
35-
export function removeReaction(
36-
options: IRemoveReactionOptions
37-
): Promise<IRemoveReactionResponse> {
38-
const { reactionId } = options;
39-
options.httpMethod = "DELETE";
40-
return discussionsApiRequest(`/reactions/${reactionId}`, options);
41-
}
42-
43-
/*******************************
44-
* V2
45-
*******************************/
46-
47-
/**
48-
* create reaction to post
49-
*
50-
* @export
51-
* @param {ICreateReactionOptions} options
52-
* @return {*} {Promise<IReaction>}
53-
*/
54-
export function createReactionV2(
55-
options: ICreateReactionOptions
56-
): Promise<IReaction> {
57-
options.httpMethod = "POST";
58-
return discussionsApiRequestV2(`/reactions`, options);
59-
}
60-
61-
/**
62-
* remove reaction
63-
*
64-
* @export
65-
* @param {IRemoveReactionOptions} options
66-
* @return {*} {Promise<IRemoveReactionResponse>}
67-
*/
68-
export function removeReactionV2(
69-
options: IRemoveReactionOptions
70-
): Promise<IRemoveReactionResponse> {
71-
const { reactionId } = options;
72-
options.httpMethod = "DELETE";
73-
return discussionsApiRequestV2(`/reactions/${reactionId}`, options);
74-
}
1+
export * from "./reactions";
Original file line numberDiff line numberDiff line change
@@ -1 +1,74 @@
1-
export * from "./reactions";
1+
import {
2+
discussionsApiRequest,
3+
discussionsApiRequestV2,
4+
} from "../discussions-api-request";
5+
import {
6+
ICreateReactionOptions,
7+
IRemoveReactionOptions,
8+
IRemoveReactionResponse,
9+
IReaction,
10+
} from "../types";
11+
12+
/**
13+
* create reaction to post
14+
*
15+
* @deprecated use createReactionV2 instead
16+
* @export
17+
* @param {ICreateReactionOptions} options
18+
* @return {*} {Promise<IReaction>}
19+
*/
20+
export function createReaction(
21+
options: ICreateReactionOptions
22+
): Promise<IReaction> {
23+
options.httpMethod = "POST";
24+
return discussionsApiRequest(`/reactions`, options);
25+
}
26+
27+
/**
28+
* remove reaction
29+
*
30+
* @deprecated use removeReactionV2 instead
31+
* @export
32+
* @param {IRemoveReactionOptions} options
33+
* @return {*} {Promise<IRemoveReactionResponse>}
34+
*/
35+
export function removeReaction(
36+
options: IRemoveReactionOptions
37+
): Promise<IRemoveReactionResponse> {
38+
const { reactionId } = options;
39+
options.httpMethod = "DELETE";
40+
return discussionsApiRequest(`/reactions/${reactionId}`, options);
41+
}
42+
43+
/*******************************
44+
* V2
45+
*******************************/
46+
47+
/**
48+
* create reaction to post
49+
*
50+
* @export
51+
* @param {ICreateReactionOptions} options
52+
* @return {*} {Promise<IReaction>}
53+
*/
54+
export function createReactionV2(
55+
options: ICreateReactionOptions
56+
): Promise<IReaction> {
57+
options.httpMethod = "POST";
58+
return discussionsApiRequestV2(`/reactions`, options);
59+
}
60+
61+
/**
62+
* remove reaction
63+
*
64+
* @export
65+
* @param {IRemoveReactionOptions} options
66+
* @return {*} {Promise<IRemoveReactionResponse>}
67+
*/
68+
export function removeReactionV2(
69+
options: IRemoveReactionOptions
70+
): Promise<IRemoveReactionResponse> {
71+
const { reactionId } = options;
72+
options.httpMethod = "DELETE";
73+
return discussionsApiRequestV2(`/reactions/${reactionId}`, options);
74+
}

0 commit comments

Comments
 (0)