Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Commit

Permalink
Lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hazelthatsme committed Nov 9, 2023
1 parent d741db4 commit d2cb22c
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 40 deletions.
4 changes: 3 additions & 1 deletion src/constants/Scopes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ const userScope = /* surrealql */ `
password: crypto::argon2::generate($password)
}
)
`;
`;

export default userScope;

Check failure on line 15 in src/constants/Scopes.ts

View workflow job for this annotation

GitHub Actions / Lint

Insert `⏎`
8 changes: 4 additions & 4 deletions src/constants/types/User.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from "zod";
import { record } from "./Common.types";
import { z } from 'zod';
import { record } from './Common.types';

const user: string = /* surrealql */ `
DEFINE TABLE user SCHEMAFULL
Expand All @@ -20,7 +20,7 @@ export const User = z.object({
id: record('user'),
username: z.string(),
email: z.string().email(),
password: z.string()
password: z.string(),
});

export default user;
export default user;
8 changes: 4 additions & 4 deletions src/library/surreal.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Surreal } from 'surrealdb.js';

export const database = new Surreal({
onConnect: () => console.log("Database connected."),
onClose: () => console.log("Database disconnected."),
onError: () => console.error("Database encountered an error.")
onConnect: () => console.log('Database connected.'),
onClose: () => console.log('Database disconnected.'),
onError: () => console.error('Database encountered an error.'),
});

export const query = (q: string) => database.query(q);
export const query = (q: string) => database.query(q);
10 changes: 5 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { createApp } from 'vue';
import { createMetaManager } from 'vue-meta';
import { createRouter, createWebHistory } from 'vue-router';
import App from '@/App.vue';
import { database } from '@/library/surreal';
import DiscoverVue from '@/routes/Discover.vue';
import HomeVue from '@/routes/Home.vue';
import LibraryVue from '@/routes/Library.vue';
import '@/style.css';
import { database } from '@/library/surreal';
import { createApp } from 'vue';
import { createMetaManager } from 'vue-meta';
import { createRouter, createWebHistory } from 'vue-router';
import RoughAuthVue from './routes/RoughAuth.vue';

database.connect(import.meta.env.VITE_DB_URL, {
namespace: 'leafal_io',
database: 'leafal_io-' + import.meta.env.MODE
database: 'leafal_io-' + import.meta.env.MODE,
});

const router = createRouter({
Expand Down
74 changes: 48 additions & 26 deletions src/routes/RoughAuth.vue
Original file line number Diff line number Diff line change
@@ -1,51 +1,73 @@
<script setup lang="ts">
import Prelaunch from '@/components/Prelaunch.vue';
import { useFeatureFlags } from '@/library/featureFlags';
import { database } from '@/library/surreal';
import { database } from '@/library/surreal';
import { ref } from 'vue';
const [flags] = useFeatureFlags();
const submitLogin = () => {
console.log("Logging in");
database.signin({
scope: 'user',
identifier: loginIdentifier.value,
password: loginPassword.value
}).then((result) => alert(result)).catch((err) => alert("Error: " + err))
}
console.log('Logging in');
database
.signin({
scope: 'user',
identifier: loginIdentifier.value,
password: loginPassword.value,
})
.then((result) => alert(result))
.catch((err) => alert('Error: ' + err));
};
const submitRegister = () => {
database.signup({
scope: 'user',
username: registerUsername.value,
email: registerEmail.value,
password: registerPassword.value
}).then((result) => alert(result)).catch((err) => alert("Error: " + err))
}
database
.signup({
scope: 'user',
username: registerUsername.value,
email: registerEmail.value,
password: registerPassword.value,
})
.then((result) => alert(result))
.catch((err) => alert('Error: ' + err));
};
const loginIdentifier = ref(""),
loginPassword = ref(""),
registerUsername = ref(""),
registerEmail = ref(""),
registerPassword = ref("");
const loginIdentifier = ref(''),
loginPassword = ref(''),
registerUsername = ref(''),
registerEmail = ref(''),
registerPassword = ref('');
</script>

<template>
<Prelaunch v-if="flags.preLaunch" />
<div v-else>
<h1>Login</h1>
<form @submit.prevent="submitLogin">
<input v-model="loginIdentifier" type="text" placeholder="Username/email">
<input v-model="loginPassword" type="password" placeholder="Password">
<input
v-model="loginIdentifier"
type="text"
placeholder="Username/email"
/>
<input
v-model="loginPassword"
type="password"
placeholder="Password"
/>
<button type="submit">Submit</button>
</form>

<h1>Register</h1>
<form @submit.prevent="submitRegister">
<input v-model="registerUsername" type="text" placeholder="Username">
<input v-model="registerEmail" type="text" placeholder="Email">
<input v-model="registerPassword" type="text" placeholder="Password">
<input
v-model="registerUsername"
type="text"
placeholder="Username"
/>
<input v-model="registerEmail" type="text" placeholder="Email" />
<input
v-model="registerPassword"
type="text"
placeholder="Password"
/>
<button type="submit">Submit</button>
</form>
</div>
Expand Down

0 comments on commit d2cb22c

Please sign in to comment.