Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions app/pages/profile/[identity]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ defineOgImageComponent('Default', {
<!-- Header -->
<header class="mb-8 pb-8 border-b border-border">
<!-- Editing Profile -->
<div v-if="isEditing" class="flex flex-col flex-wrap gap-4">
<form v-if="isEditing" class="flex flex-col flex-wrap gap-4" @submit.prevent="updateProfile">
<label for="displayName" class="text-sm flex flex-col gap-2">
{{ $t('profile.display_name') }}
<input
Expand Down Expand Up @@ -145,18 +145,14 @@ defineOgImageComponent('Default', {
</label>
<div class="flex gap-4 items-center font-mono text-sm">
<h2>@{{ profile?.handle }}</h2>
<ButtonBase @click="isEditing = false">
<ButtonBase @click="isEditing = false" type="button">
{{ $t('common.cancel') }}
</ButtonBase>
<ButtonBase
@click="updateProfile"
variant="primary"
:disabled="isUpdateProfileActionPending"
>
<ButtonBase variant="primary" :disabled="isUpdateProfileActionPending" type="submit">
{{ $t('common.save') }}
</ButtonBase>
</div>
</div>
</form>

<!-- Display Profile -->
<div v-else class="flex flex-col flex-wrap gap-4">
Expand Down
7 changes: 6 additions & 1 deletion server/api/social/profile/[identifier]/index.put.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ export default eventHandlerWithOAuthSession(async (event, oAuthSession) => {

await throwOnMissingOAuthScope(oAuthSession, PROFILE_SCOPE)

const body = parse(ProfileEditBodySchema, await readBody(event))
const requestBody = await readBody(event)
if (requestBody.website && !URL.canParse(requestBody.website)) {
throw createError({ statusCode: 400, statusMessage: 'Invalid website' })
}

const body = parse(ProfileEditBodySchema, requestBody)
const client = new Client(oAuthSession)

const profile = dev.npmx.actor.profile.$build({
Expand Down
Loading