Merge branch 'fix-creating-event-from-group' into 'master'
Various fixes Closes #712 See merge request framasoft/mobilizon!950
This commit is contained in:
commit
de8e86f519
@ -34,6 +34,11 @@ export const possibleTypes = types.reduce((acc, type) => {
|
||||
return acc;
|
||||
}, {} as Record<string, string[]>);
|
||||
|
||||
const replaceMergePolicy = <TExisting = any, TIncoming = any>(
|
||||
_existing: TExisting,
|
||||
incoming: TIncoming
|
||||
): TIncoming => incoming;
|
||||
|
||||
export const typePolicies: TypePolicies = {
|
||||
Discussion: {
|
||||
fields: {
|
||||
@ -61,6 +66,8 @@ export const typePolicies: TypePolicies = {
|
||||
participants: paginatedLimitPagination<IParticipant>(["roles"]),
|
||||
comments: pageLimitPagination<IComment>(),
|
||||
relatedEvents: pageLimitPagination<IEvent>(),
|
||||
options: { merge: replaceMergePolicy },
|
||||
participantStats: { merge: replaceMergePolicy },
|
||||
},
|
||||
},
|
||||
RootQueryType: {
|
||||
|
@ -190,7 +190,6 @@ export default class OrganizerPickerWrapper extends Vue {
|
||||
setInitialActor(): void {
|
||||
if (this.$route.query?.actorId) {
|
||||
const actorId = this.$route.query?.actorId as string;
|
||||
this.$router.replace({ query: undefined });
|
||||
const actor = this.userMemberships.elements.find(
|
||||
({ parent: { id }, role }) =>
|
||||
actorId === id && MEMBER_ROLES.includes(role)
|
||||
|
@ -17,7 +17,7 @@ defmodule Mobilizon.Storage.Repo.Migrations.CleanupPosts do
|
||||
Mobilizon.Storage.Repo,
|
||||
"SELECT * FROM (
|
||||
SELECT id, url,
|
||||
ROW_NUMBER() OVER(PARTITION BY url ORDER BY id asc) AS Row
|
||||
ROW_NUMBER() OVER(PARTITION BY url ORDER BY inserted_at asc) AS Row
|
||||
FROM posts
|
||||
) dups
|
||||
WHERE dups.Row > 1;"
|
||||
@ -50,7 +50,7 @@ defmodule Mobilizon.Storage.Repo.Migrations.CleanupPosts do
|
||||
defp repair_post_medias(id, first_id) do
|
||||
Ecto.Adapters.SQL.query!(
|
||||
Mobilizon.Storage.Repo,
|
||||
"UPDATE post_medias SET post_id = $1 WHERE post_id = $2",
|
||||
"UPDATE posts_medias SET post_id = $1 WHERE post_id = $2",
|
||||
[first_id, id]
|
||||
)
|
||||
end
|
||||
@ -58,7 +58,7 @@ defmodule Mobilizon.Storage.Repo.Migrations.CleanupPosts do
|
||||
defp repair_post_tags(id, first_id) do
|
||||
Ecto.Adapters.SQL.query!(
|
||||
Mobilizon.Storage.Repo,
|
||||
"UPDATE post_tags SET post_id = $1 WHERE post_id = $2",
|
||||
"UPDATE posts_tags SET post_id = $1 WHERE post_id = $2",
|
||||
[first_id, id]
|
||||
)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user