Skip to content

Commit

Permalink
Fix a couple build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnaab committed Aug 22, 2024
1 parent e028700 commit c5d0142
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions apps/spotlight/src/context.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import {
type FormService,
type FormConfig,
createBrowserFormService,
type FormService,
createFormService,
createTestFormService,
} from '@atj/forms';
import { defaultFormConfig } from '@atj/forms';
import { BrowserFormRepository } from '@atj/forms/src/context/browser/form-repo';

import { type GithubRepository } from './lib/github';

Expand Down Expand Up @@ -37,7 +38,11 @@ const createAppContext = (env: any): AppContext => {

const createAppFormService = () => {
if (globalThis.window) {
return createBrowserFormService();
const db = new BrowserFormRepository(window.localStorage);
return createFormService({
db,
config: defaultFormConfig,
});
} else {
return createTestFormService();
}
Expand Down
4 changes: 2 additions & 2 deletions packages/forms/src/context/browser/form-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class BrowserFormRepository implements FormRepository {

async addForm(
form: Blueprint
): Promise<Result<{ timestamp: Date; id: string }>> {
): Promise<Result<{ timestamp: string; id: string }>> {
const uuid = crypto.randomUUID();

const result = await this.saveForm(uuid, form);
Expand All @@ -19,7 +19,7 @@ export class BrowserFormRepository implements FormRepository {
return {
success: true,
data: {
timestamp: new Date(),
timestamp: new Date().toISOString(),
id: uuid,
},
};
Expand Down

0 comments on commit c5d0142

Please sign in to comment.