supported apps domain + some refactor of data types redundancy
This commit is contained in:
@@ -3,18 +3,24 @@ import { nanoid } from "nanoid";
|
||||
import { db } from "@pkg/db";
|
||||
import { type Err } from "@pkg/result";
|
||||
import { FlowExecCtx } from "@core/flow.execution.context";
|
||||
import { CreateLink, Link, LinkStatus, LinkWithDevice, UpdateLink } from "./data";
|
||||
import {
|
||||
CreateLink,
|
||||
Link,
|
||||
LinkStatus,
|
||||
LinkWithDevice,
|
||||
UpdateLink,
|
||||
} from "./data";
|
||||
import { LinkRepository } from "./repository";
|
||||
import { linkErrors } from "./errors";
|
||||
|
||||
export class LinkController {
|
||||
constructor(private repo: LinkRepository) {}
|
||||
|
||||
list(fctx: FlowExecCtx): ResultAsync<Link[], Err> {
|
||||
list(fctx: FlowExecCtx): ResultAsync<LinkWithDevice[], Err> {
|
||||
return this.repo.list(fctx);
|
||||
}
|
||||
|
||||
getById(fctx: FlowExecCtx, id: number): ResultAsync<Link, Err> {
|
||||
getById(fctx: FlowExecCtx, id: number): ResultAsync<LinkWithDevice, Err> {
|
||||
return this.repo.getById(fctx, id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user