drop group name requirement

This commit is contained in:
Hayden 2022-10-09 07:59:33 -05:00
parent 132e5d10da
commit 8ff99f5b62
9 changed files with 5 additions and 19 deletions

View file

@ -23,7 +23,8 @@ tasks:
python3 ./scripts/process-types.py ./frontend/lib/api/types/data-contracts.ts
sources:
- "./backend/app/api/**/*"
- "./backend/app/internal/types/**/*"
- "./backend/internal/repo/**/*"
- "./backend/internal/services/**/*"
- "./scripts/process-types.py"
generates:
- "./frontend/lib/api/types/data-contracts.ts"

View file

@ -1531,9 +1531,6 @@ const docTemplate = `{
"email": {
"type": "string"
},
"groupName": {
"type": "string"
},
"name": {
"type": "string"
},

View file

@ -1523,9 +1523,6 @@
"email": {
"type": "string"
},
"groupName": {
"type": "string"
},
"name": {
"type": "string"
},

View file

@ -322,8 +322,6 @@ definitions:
properties:
email:
type: string
groupName:
type: string
name:
type: string
password:

View file

@ -28,7 +28,6 @@ type (
Name string `json:"name"`
Email string `json:"email"`
Password string `json:"password"`
GroupName string `json:"groupName"`
}
UserAuthTokenDetail struct {
Raw string `json:"raw"`
@ -46,7 +45,6 @@ func (svc *UserService) RegisterUser(ctx context.Context, data UserRegistration)
log.Debug().
Str("name", data.Name).
Str("email", data.Email).
Str("groupName", data.GroupName).
Str("groupToken", data.GroupToken).
Msg("Registering new user")
@ -57,7 +55,7 @@ func (svc *UserService) RegisterUser(ctx context.Context, data UserRegistration)
)
if data.GroupToken == "" {
group, err = svc.repos.Groups.GroupCreate(ctx, data.GroupName)
group, err = svc.repos.Groups.GroupCreate(ctx, "Home")
if err != nil {
log.Err(err).Msg("Failed to create group")
return repo.UserOut{}, err

View file

@ -8,7 +8,6 @@ function userFactory(): UserRegistration {
email: faker.internet.email(),
password: faker.internet.password(),
name: faker.name.firstName(),
groupName: faker.animal.cat(),
token: "",
};
}

View file

@ -30,10 +30,10 @@ export async function sharedUserClient(): Promise<UserClient> {
return userClient(cache.token);
}
const testUser = {
groupName: "test-group",
email: "__test__@__test__.com",
name: "__test__",
password: "__test__",
token: "",
};
const api = client();

View file

@ -219,7 +219,6 @@ export interface ServerValidationError {
export interface UserRegistration {
email: string;
groupName: string;
name: string;
password: string;
token: string;

View file

@ -21,7 +21,6 @@
const username = ref("");
const email = ref("");
const groupName = ref("");
const password = ref("");
const canRegister = ref(false);
@ -50,7 +49,6 @@
name: username.value,
email: email.value,
password: password.value,
groupName: groupName.value,
token: groupToken.value,
});
@ -152,8 +150,7 @@
</h2>
<FormTextField v-model="email" label="Set your email?" />
<FormTextField v-model="username" label="What's your name?" />
<FormTextField v-if="groupToken == ''" v-model="groupName" label="Name your group" />
<div v-else class="pt-4 pb-1 text-center">
<div v-if="!(groupToken == '')" class="pt-4 pb-1 text-center">
<p>You're Joining an Existing Group!</p>
<button type="button" class="text-xs underline" @click="groupToken = ''">
Don't Want To Join a Group?