Merge branch 'more-fixes' into shigusegubu-themes3
This commit is contained in:
commit
182cf5aff6
12 changed files with 11 additions and 32 deletions
|
|
@ -312,9 +312,6 @@ export const deleteAnnouncement = ({ id, credentials }) =>
|
|||
})
|
||||
|
||||
export const setReportState = ({ id, state, credentials }) => {
|
||||
// TODO: Can't use promisedRequest because on OK this does not return json
|
||||
// See https://git.pleroma.social/pleroma/pleroma-fe/-/merge_requests/1322
|
||||
|
||||
return promisedRequest({
|
||||
url: REPORTS,
|
||||
credentials,
|
||||
|
|
@ -328,19 +325,6 @@ export const setReportState = ({ id, state, credentials }) => {
|
|||
],
|
||||
},
|
||||
})
|
||||
.then((data) => {
|
||||
if (data.status >= 500) {
|
||||
throw Error(data.statusText)
|
||||
} else if (data.status >= 400) {
|
||||
return data.json()
|
||||
}
|
||||
return data
|
||||
})
|
||||
.then((data) => {
|
||||
if (data.errors) {
|
||||
throw Error(data.errors[0].message)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export const getInstanceDBConfig = ({ credentials }) =>
|
||||
|
|
|
|||
|
|
@ -842,7 +842,6 @@ export const getList = ({ listId, credentials }) =>
|
|||
})
|
||||
|
||||
export const updateList = ({ listId, title, credentials }) =>
|
||||
console.log('PUT', MASTODON_LIST_URL(listId)) ||
|
||||
promisedRequest({
|
||||
url: MASTODON_LIST_URL(listId),
|
||||
|
||||
|
|
|
|||
|
|
@ -634,6 +634,7 @@ const PostStatusForm = {
|
|||
// Don't apply preview if not loading, because it means
|
||||
// user has closed the preview manually.
|
||||
if (!this.previewLoading) return
|
||||
this.preview = data
|
||||
})
|
||||
.catch((error) => {
|
||||
this.preview = { error }
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ const UserReportingModal = {
|
|||
return !!this.$store.state.users.currentUser
|
||||
},
|
||||
isOpen() {
|
||||
console.log(this.reportModal)
|
||||
return this.isLoggedIn && this.reportModal.activated
|
||||
},
|
||||
userId() {
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ function humanizeErrors(errors) {
|
|||
export function StatusCodeError(statusCode, body, options, response) {
|
||||
this.name = 'StatusCodeError'
|
||||
this.statusCode = statusCode
|
||||
this.statusText = body.error || body
|
||||
this.statusText = body.error || body.errors || body
|
||||
this.details = JSON && JSON.stringify ? JSON.stringify(body) : body
|
||||
this.errorData = body.error
|
||||
this.errorData = body.error || body.errors
|
||||
this.message = this.statusCode + ' - ' + this.statusText
|
||||
this.error = body // legacy attribute
|
||||
this.options = options
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@ import { useOAuthStore } from 'src/stores/oauth.js'
|
|||
|
||||
import { fetchOAuthTokens, revokeOAuthToken } from 'src/api/user.js'
|
||||
|
||||
/* Just to clear the confusion:
|
||||
* OAuth Store is responsible for user authentication
|
||||
* OAuth Tokens Store is responsible for *managing* all of the user's tokens,
|
||||
* i.e. for current and other clients
|
||||
*/
|
||||
export const useOAuthTokensStore = defineStore('oauthTokens', {
|
||||
state: () => ({
|
||||
tokens: [],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue