diff --git a/components/actors/add.vue b/components/actors/add.vue index 6cf04a2..308240b 100644 --- a/components/actors/add.vue +++ b/components/actors/add.vue @@ -148,6 +148,10 @@ async function addActor() { gap: 1.25rem; } +.input { + width: 100%; +} + .load-container { width: 100%; display: inline-flex; diff --git a/components/actors/merge.vue b/components/actors/merge.vue index 2dad31e..6d68874 100644 --- a/components/actors/merge.vue +++ b/components/actors/merge.vue @@ -52,7 +52,8 @@ function getActorNames() { async function merge() { submitted.value = true; - await post(`/actors/${targetActor.value.id}/merge/${props.actors.map((actor) => actor.id).join(',')}`, { + await post(`/actors/${targetActor.value.id}/merge`, { + actorIds: props.actors.map((actor) => actor.id), comment: comment.value || null, }, { successFeedback: `Merged ${getActorNames()} into ${targetActor.value.name}`, diff --git a/components/emails/unavailable.vue b/components/emails/unavailable.vue index b100c99..c344157 100644 --- a/components/emails/unavailable.vue +++ b/components/emails/unavailable.vue @@ -55,7 +55,7 @@ const mockUser = { style="margin-top: 30px;" >Someone tried to assign this e-mail address to a traxxx account. - If this was you with this account, your e-mail address is already set correctly. If this was you with another account, you will need to use another e-mail address. If this was not you, you can safely ignore this e-mail. + If this was you with this account ({{ user.username }}), your e-mail address is already set correctly. If this was you with another account, you will need to use another e-mail address. If this was not you, you can safely ignore this e-mail. diff --git a/src/actors.js b/src/actors.js index a03df63..4a209ca 100644 --- a/src/actors.js +++ b/src/actors.js @@ -870,7 +870,9 @@ export async function mergeActors(targetActorId, sourceActorIds, comment, reqUse // some avatars are not matched to a profile, need to investigate why this happens and the avatar table needs a dedicated actor field trx('actors_avatars') .update('actor_id', targetActorId) - .whereIn('actor_id', sourceActorIds), + .whereIn('actor_id', sourceActorIds) + .onConflict(['profile_id', 'media_id']) + .ignore(), ]); // multiple source actors may provide profiles for the same entity, but we can only assign one to the target actor; prefer the newest diff --git a/src/web/actors.js b/src/web/actors.js index d5badf8..780fb4f 100644 --- a/src/web/actors.js +++ b/src/web/actors.js @@ -194,7 +194,7 @@ export async function createActorApi(req, res) { export async function mergeActorsApi(req, res) { const result = await mergeActors( Number(req.params.targetActorId), - req.params.sourceActorIds.split(',').map((actorId) => Number(actorId)), + req.body.actorIds, req.body.comment, req.user, ); @@ -225,7 +225,7 @@ export const actorsRouter = Router(); actorsRouter.get('/api/actors', fetchActorsApi); actorsRouter.post('/api/actors', createActorApi); -actorsRouter.post('/api/actors/:targetActorId/merge/:sourceActorIds', mergeActorsApi); +actorsRouter.post('/api/actors/:targetActorId/merge', mergeActorsApi); actorsRouter.get('/api/revisions/actors', fetchActorRevisionsApi); actorsRouter.get('/api/revisions/actors/:revisionId', fetchActorRevisionsApi);