fix(frontend): simple user must not try to fetch feed tokens ; fix #1759
This commit is contained in:
@@ -18,9 +18,29 @@ export const ACTOR_FRAGMENT = gql`
|
|||||||
|
|
||||||
// Do not request mediaSize here because mediaSize can only be accessed
|
// Do not request mediaSize here because mediaSize can only be accessed
|
||||||
// by user_himself/moderator/administrator (can_get_actor_size? in media.ex)
|
// by user_himself/moderator/administrator (can_get_actor_size? in media.ex)
|
||||||
|
// same goes for feed tokens, they are private
|
||||||
// - FETCH_PERSON is used by <NewConversation> and can be used by simple users here
|
// - FETCH_PERSON is used by <NewConversation> and can be used by simple users here
|
||||||
// - FETCH_PERSON is also used in <EditIdentity> but mediaSize is not used there
|
|
||||||
export const FETCH_PERSON = gql`
|
export const FETCH_PERSON = gql`
|
||||||
|
query FetchPerson($username: String!) {
|
||||||
|
fetchPerson(preferredUsername: $username) {
|
||||||
|
...ActorFragment
|
||||||
|
suspended
|
||||||
|
avatar {
|
||||||
|
uuid
|
||||||
|
name
|
||||||
|
url
|
||||||
|
}
|
||||||
|
banner {
|
||||||
|
uuid
|
||||||
|
url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
${ACTOR_FRAGMENT}
|
||||||
|
`;
|
||||||
|
|
||||||
|
// used in <EditIdentity>
|
||||||
|
export const FETCH_PERSON_OWNED = gql`
|
||||||
query FetchPerson($username: String!) {
|
query FetchPerson($username: String!) {
|
||||||
fetchPerson(preferredUsername: $username) {
|
fetchPerson(preferredUsername: $username) {
|
||||||
...ActorFragment
|
...ActorFragment
|
||||||
@@ -42,6 +62,7 @@ export const FETCH_PERSON = gql`
|
|||||||
${ACTOR_FRAGMENT}
|
${ACTOR_FRAGMENT}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
// used by admin panel, profile view
|
||||||
export const GET_PERSON = gql`
|
export const GET_PERSON = gql`
|
||||||
query Person(
|
query Person(
|
||||||
$actorId: ID!
|
$actorId: ID!
|
||||||
|
|||||||
@@ -197,7 +197,7 @@
|
|||||||
import {
|
import {
|
||||||
CREATE_PERSON,
|
CREATE_PERSON,
|
||||||
DELETE_PERSON,
|
DELETE_PERSON,
|
||||||
FETCH_PERSON,
|
FETCH_PERSON_OWNED,
|
||||||
IDENTITIES,
|
IDENTITIES,
|
||||||
PERSON_FRAGMENT,
|
PERSON_FRAGMENT,
|
||||||
PERSON_FRAGMENT_FEED_TOKENS,
|
PERSON_FRAGMENT_FEED_TOKENS,
|
||||||
@@ -250,7 +250,7 @@ const {
|
|||||||
} = useQuery<{
|
} = useQuery<{
|
||||||
fetchPerson: IPerson;
|
fetchPerson: IPerson;
|
||||||
}>(
|
}>(
|
||||||
FETCH_PERSON,
|
FETCH_PERSON_OWNED,
|
||||||
() => ({
|
() => ({
|
||||||
username: props.identityName,
|
username: props.identityName,
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user