diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-08 10:55:16 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:17 +0200 |
commit | a1637fa1e25b60a88f7cfe50aac8953f50d55761 (patch) | |
tree | 4d0cc82eef618619a7bcb747812cc7b21e0d8776 /shared/extra-utils/moderation | |
parent | 04aed76711909507e74905bde3a7fa024d3585c9 (diff) | |
download | PeerTube-a1637fa1e25b60a88f7cfe50aac8953f50d55761.tar.gz PeerTube-a1637fa1e25b60a88f7cfe50aac8953f50d55761.tar.zst PeerTube-a1637fa1e25b60a88f7cfe50aac8953f50d55761.zip |
Specify if we want to fallback to the server token
Diffstat (limited to 'shared/extra-utils/moderation')
-rw-r--r-- | shared/extra-utils/moderation/abuses-command.ts | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/shared/extra-utils/moderation/abuses-command.ts b/shared/extra-utils/moderation/abuses-command.ts index 59126d0a9..03da0c85a 100644 --- a/shared/extra-utils/moderation/abuses-command.ts +++ b/shared/extra-utils/moderation/abuses-command.ts | |||
@@ -60,6 +60,7 @@ export class AbusesCommand extends AbstractCommand { | |||
60 | 60 | ||
61 | path, | 61 | path, |
62 | fields: body, | 62 | fields: body, |
63 | implicitToken: true, | ||
63 | defaultExpectedStatus: HttpStatusCode.OK_200 | 64 | defaultExpectedStatus: HttpStatusCode.OK_200 |
64 | })) | 65 | })) |
65 | } | 66 | } |
@@ -106,6 +107,7 @@ export class AbusesCommand extends AbstractCommand { | |||
106 | 107 | ||
107 | path, | 108 | path, |
108 | query, | 109 | query, |
110 | implicitToken: true, | ||
109 | defaultExpectedStatus: HttpStatusCode.OK_200 | 111 | defaultExpectedStatus: HttpStatusCode.OK_200 |
110 | }) | 112 | }) |
111 | } | 113 | } |
@@ -138,6 +140,7 @@ export class AbusesCommand extends AbstractCommand { | |||
138 | 140 | ||
139 | path, | 141 | path, |
140 | query, | 142 | query, |
143 | implicitToken: true, | ||
141 | defaultExpectedStatus: HttpStatusCode.OK_200 | 144 | defaultExpectedStatus: HttpStatusCode.OK_200 |
142 | }) | 145 | }) |
143 | } | 146 | } |
@@ -154,6 +157,7 @@ export class AbusesCommand extends AbstractCommand { | |||
154 | 157 | ||
155 | path, | 158 | path, |
156 | fields: body, | 159 | fields: body, |
160 | implicitToken: true, | ||
157 | defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 | 161 | defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 |
158 | }) | 162 | }) |
159 | } | 163 | } |
@@ -164,7 +168,13 @@ export class AbusesCommand extends AbstractCommand { | |||
164 | const { abuseId } = options | 168 | const { abuseId } = options |
165 | const path = '/api/v1/abuses/' + abuseId | 169 | const path = '/api/v1/abuses/' + abuseId |
166 | 170 | ||
167 | return this.deleteRequest({ ...options, path, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) | 171 | return this.deleteRequest({ |
172 | ...options, | ||
173 | |||
174 | path, | ||
175 | implicitToken: true, | ||
176 | defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 | ||
177 | }) | ||
168 | } | 178 | } |
169 | 179 | ||
170 | listMessages (options: OverrideCommandOptions & { | 180 | listMessages (options: OverrideCommandOptions & { |
@@ -173,7 +183,13 @@ export class AbusesCommand extends AbstractCommand { | |||
173 | const { abuseId } = options | 183 | const { abuseId } = options |
174 | const path = '/api/v1/abuses/' + abuseId + '/messages' | 184 | const path = '/api/v1/abuses/' + abuseId + '/messages' |
175 | 185 | ||
176 | return this.getRequestBody<ResultList<AbuseMessage>>({ ...options, path, defaultExpectedStatus: HttpStatusCode.OK_200 }) | 186 | return this.getRequestBody<ResultList<AbuseMessage>>({ |
187 | ...options, | ||
188 | |||
189 | path, | ||
190 | implicitToken: true, | ||
191 | defaultExpectedStatus: HttpStatusCode.OK_200 | ||
192 | }) | ||
177 | } | 193 | } |
178 | 194 | ||
179 | deleteMessage (options: OverrideCommandOptions & { | 195 | deleteMessage (options: OverrideCommandOptions & { |
@@ -183,7 +199,13 @@ export class AbusesCommand extends AbstractCommand { | |||
183 | const { abuseId, messageId } = options | 199 | const { abuseId, messageId } = options |
184 | const path = '/api/v1/abuses/' + abuseId + '/messages/' + messageId | 200 | const path = '/api/v1/abuses/' + abuseId + '/messages/' + messageId |
185 | 201 | ||
186 | return this.deleteRequest({ ...options, path, defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 }) | 202 | return this.deleteRequest({ |
203 | ...options, | ||
204 | |||
205 | path, | ||
206 | implicitToken: true, | ||
207 | defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204 | ||
208 | }) | ||
187 | } | 209 | } |
188 | 210 | ||
189 | addMessage (options: OverrideCommandOptions & { | 211 | addMessage (options: OverrideCommandOptions & { |
@@ -198,6 +220,7 @@ export class AbusesCommand extends AbstractCommand { | |||
198 | 220 | ||
199 | path, | 221 | path, |
200 | fields: { message }, | 222 | fields: { message }, |
223 | implicitToken: true, | ||
201 | defaultExpectedStatus: HttpStatusCode.OK_200 | 224 | defaultExpectedStatus: HttpStatusCode.OK_200 |
202 | }) | 225 | }) |
203 | } | 226 | } |