Skip to content

Commit

Permalink
Merge pull request #107 from pastemyst/hotfix/account-creation
Browse files Browse the repository at this point in the history
[client] refreshing page after account creation
  • Loading branch information
CodeMyst committed Aug 4, 2022
2 parents bee8e80 + 0c2f7eb commit f71c654
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func main() {

deletedCount, err := db.DBQueries.DeleteExpiredPastes(db.DBContext)
if err != nil {
logging.Logger.Errorf("Faield to delete expired pastes: %s", err.Error())
logging.Logger.Errorf("Failed to delete expired pastes: %s", err.Error())
return
}

Expand Down
28 changes: 14 additions & 14 deletions api/schema.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
create type expires_in as enum ('never', '1h', '2h', '10h', '1d', '2d', '1w', '1m', '1y');

create table if not exists users (
id text not null constraint user_pk primary key,
created_at timestamp with time zone default now() not null,
username text default '' :: text not null,
avatar_url text default '' :: text not null,
contributor boolean default false not null,
supporter integer default 0 not null,
provider_name text default '' :: text not null,
provider_id text default '' :: text not null
);

alter table
users owner to pastemyst;

create table if not exists pastes (
id text not null constraint paste_pk primary key,
created_at timestamp with time zone default now() not null,
Expand All @@ -25,17 +39,3 @@ create table if not exists pasties (

alter table
pasties owner to pastemyst;

create table if not exists users (
id text not null constraint user_pk primary key,
created_at timestamp with time zone default now() not null,
username text default '' :: text not null,
avatar_url text default '' :: text not null,
contributor boolean default false not null,
supporter integer default 0 not null,
provider_name text default '' :: text not null,
provider_id text default '' :: text not null
);

alter table
users owner to pastemyst;
4 changes: 3 additions & 1 deletion client/src/routes/create-account.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
if (createAccountErrorMsg) return;
goto("/");
// not using goto("/") becase the page needs to get refreshed
// so the current account gets updated
window.location.href = "/";
};
const validateUsername = async () => {
Expand Down

0 comments on commit f71c654

Please sign in to comment.