working on the api now

This commit is contained in:
Eclypsed
2024-01-30 12:27:37 -05:00
parent 675e2b2d68
commit fcbcf6780d
4 changed files with 53 additions and 6 deletions

View File

@@ -15,11 +15,11 @@ type UserQueryParams = {
includePassword?: boolean
}
interface DBServiceData {
export interface DBServiceData {
id: string
type: ServiceType
userId: string
url: URL
url: string
}
interface DBServiceRow {
@@ -29,7 +29,7 @@ interface DBServiceRow {
url: string
}
interface DBConnectionData {
export interface DBConnectionData {
id: string
user: User
service: DBServiceData
@@ -81,7 +81,7 @@ export class Users {
export class Services {
static getService = (id: string): DBServiceData => {
const { type, userId, url } = db.prepare('SELECT * FROM Users WHERE id = ?').get(id) as DBServiceRow
const service: DBServiceData = { id, type: type as ServiceType, userId, url: new URL(url) }
const service: DBServiceData = { id, type: type as ServiceType, userId, url }
return service
}