main
|
Last change
on this file since e729b88 was 226fbbb, checked in by Tome <gjorgievtome@…>, 7 months ago |
|
Update telefunctions
|
-
Property mode
set to
100644
|
|
File size:
622 bytes
|
| Line | |
|---|
| 1 | import * as drizzleQueries from "../../database/drizzle/queries";
|
|---|
| 2 | import {ctx, getAuthState, requireUser} from "../../server/telefunc/ctx";
|
|---|
| 3 | import {Abort} from "telefunc";
|
|---|
| 4 | import type {Database} from "../../database/drizzle/db";
|
|---|
| 5 |
|
|---|
| 6 | export async function onSaveNewBuild({ name, description, componentIds }
|
|---|
| 7 | : { name: string; description: string; componentIds: number[] }) {
|
|---|
| 8 | const { c, userId } = requireUser()
|
|---|
| 9 |
|
|---|
| 10 | const newBuildId = await drizzleQueries.addNewBuild(c.db, userId, name, description, componentIds);
|
|---|
| 11 |
|
|---|
| 12 | if(!newBuildId) throw Abort();
|
|---|
| 13 |
|
|---|
| 14 | return { success: true };
|
|---|
| 15 | } |
|---|
Note:
See
TracBrowser
for help on using the repository browser.