-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add spotify email during sign up
- Loading branch information
1 parent
f293ac1
commit 898763f
Showing
6 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
swapify_api/priv/repo/migrations/20241128222502_add_optional_spotify_email.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
defmodule SwapifyApi.Repo.Migrations.AddOptionalSpotifyEmail do | ||
use Ecto.Migration | ||
|
||
def change do | ||
alter table(:users) do | ||
add :spotify_account_email, :string, null: true | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,14 @@ import { PasswordSchema, SchemaForm } from "#root/components/schema-form"; | |
export const SIGN_UP_FORM_ID = "sign-up-form"; | ||
|
||
const SignUpFormSchema = z.object({ | ||
username: z.string().describe("Username // e.g. llCoolChris_"), | ||
username: z.string().min(2).max(20).describe("Username // e.g. llCoolChris_"), | ||
email: z.string().email().describe("Email // e.g. [email protected]"), | ||
password: PasswordSchema.describe("Password"), | ||
spotifyAccountEmail: z | ||
.string() | ||
.email() | ||
.optional() | ||
.describe("Spotify account email"), | ||
}); | ||
export type SignUpFormData = z.infer<typeof SignUpFormSchema>; | ||
|
||
|
@@ -28,6 +33,10 @@ export function SignUpForm({ isLoading, handleSubmit, form }: SignUpFormProps) { | |
password: { | ||
helperText: "Password must be at least 8 characters", | ||
}, | ||
spotifyAccountEmail: { | ||
helperText: | ||
"We need your Spotify account email for the beta program, since Spotify has not approved out app yet!", | ||
}, | ||
}} | ||
onSubmit={handleSubmit} | ||
formProps={{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters