quantumleaps
quantumleaps
Explore posts from servers
DTDrizzle Team
Created by quantumleaps on 2/21/2025 in #help
Error loading books: TypeError: Cannot read properties of undefined (reading 'referencedTable')
bump
7 replies
DTDrizzle Team
Created by quantumleaps on 2/21/2025 in #help
Error loading books: TypeError: Cannot read properties of undefined (reading 'referencedTable')
do I need to define relations manually?
7 replies
DTDrizzle Team
Created by quantumleaps on 2/21/2025 in #help
Error loading books: TypeError: Cannot read properties of undefined (reading 'referencedTable')
sample code :
const books = await db.query.book.findMany({
with: {
images: true,
files: true,
pricing: true,

}) ?? [];
const books = await db.query.book.findMany({
with: {
images: true,
files: true,
pricing: true,

}) ?? [];
7 replies
DTDrizzle Team
Created by quantumleaps on 2/21/2025 in #help
Error loading books: TypeError: Cannot read properties of undefined (reading 'referencedTable')
sample schema :
export const book = sqliteTable("books", {
id: text("id").primaryKey(),
title: text('title').notNull(),
description: text('description'),
isbn: text('isbn'),
authors: text('authors').notNull(),
language: text('language').notNull().default('english'),
createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
updatedAt: integer('updated_at', { mode: 'timestamp' }).notNull(),
});

export const bookImages = sqliteTable("book_images", {
id: text("id").primaryKey(),
bookId: text('book_id').notNull().references(() => book.id),
url: text('url').notNull(),
order: integer('order').notNull().default(0),
createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
updatedAt: integer('updated_at', { mode: 'timestamp' }).notNull(),
});

export const bookFiles = sqliteTable("book_files", {
id: text("id").primaryKey(),
bookId: text('book_id').notNull().references(() => book.id),
downloadUrl: text('download_url').notNull(),
fileType: text('file_type').notNull(),
fileSize: text('file_size').notNull(),
createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
updatedAt: integer('updated_at', { mode: 'timestamp' }).notNull(),
});

// Pricing & Inventory
export const pricing = sqliteTable('pricing', {
id: text('id').primaryKey(),
bookId: text('book_id').references(() => book.id),
price: real('price').notNull(),
currency: text('currency').notNull().default('USD'),
createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
updatedAt: integer('updated_at', { mode: 'timestamp' }).notNull(),
});
export const book = sqliteTable("books", {
id: text("id").primaryKey(),
title: text('title').notNull(),
description: text('description'),
isbn: text('isbn'),
authors: text('authors').notNull(),
language: text('language').notNull().default('english'),
createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
updatedAt: integer('updated_at', { mode: 'timestamp' }).notNull(),
});

export const bookImages = sqliteTable("book_images", {
id: text("id").primaryKey(),
bookId: text('book_id').notNull().references(() => book.id),
url: text('url').notNull(),
order: integer('order').notNull().default(0),
createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
updatedAt: integer('updated_at', { mode: 'timestamp' }).notNull(),
});

export const bookFiles = sqliteTable("book_files", {
id: text("id").primaryKey(),
bookId: text('book_id').notNull().references(() => book.id),
downloadUrl: text('download_url').notNull(),
fileType: text('file_type').notNull(),
fileSize: text('file_size').notNull(),
createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
updatedAt: integer('updated_at', { mode: 'timestamp' }).notNull(),
});

// Pricing & Inventory
export const pricing = sqliteTable('pricing', {
id: text('id').primaryKey(),
bookId: text('book_id').references(() => book.id),
price: real('price').notNull(),
currency: text('currency').notNull().default('USD'),
createdAt: integer('created_at', { mode: 'timestamp' }).notNull(),
updatedAt: integer('updated_at', { mode: 'timestamp' }).notNull(),
});
7 replies
FFilament
Created by quantumleaps on 11/12/2024 in #❓┊help
upload image from afterStateUpdate of another component
bump... if anyone knows how to
4 replies
FFilament
Created by quantumleaps on 11/10/2024 in #❓┊help
disable or fix fileupload validation
nvm, just removed the field, final code :
Forms\Components\FileUpload::make('product_ean_image_url')
->label('Product EAN Image')
->required()
->rule([
'mimes:jpg,jpeg,png,gif'
]),
Forms\Components\FileUpload::make('product_ean_image_url')
->label('Product EAN Image')
->required()
->rule([
'mimes:jpg,jpeg,png,gif'
]),
23 replies
FFilament
Created by quantumleaps on 11/10/2024 in #❓┊help
disable or fix fileupload validation
No description
23 replies
FFilament
Created by quantumleaps on 11/10/2024 in #❓┊help
disable or fix fileupload validation
i tried to look up if there's any way I can disable client side validation, and couldn't find it either
23 replies
FFilament
Created by quantumleaps on 11/10/2024 in #❓┊help
disable or fix fileupload validation
i think it probably has something to do with how filament checks for file type/mimes with accept values (maybe it doesn't split the string properly, as it wouldn't expect ; in attribute value)
23 replies
FFilament
Created by quantumleaps on 11/10/2024 in #❓┊help
disable or fix fileupload validation
No description
23 replies
FFilament
Created by quantumleaps on 11/10/2024 in #❓┊help
disable or fix fileupload validation
only option 1, no choice for option 2
23 replies
FFilament
Created by quantumleaps on 11/10/2024 in #❓┊help
disable or fix fileupload validation
you're right, it isn't mentioned anywhere in the docs, I found it in a stackoverflow solution. But it's the only way I found that gives both options
23 replies
FFilament
Created by quantumleaps on 11/10/2024 in #❓┊help
disable or fix fileupload validation
i think I didn't explain it properly there are 2 ways to upload an image 1) Pick from file manager 2) Click one from camera
<input type=“file” accept=“image/*;capture=camera”>
<input type=“file” accept=“image/*;capture=camera”>
Gives both option 1 & 2 if I use
<input type=“file” accept=“image/*" capture="environment”>
<input type=“file” accept=“image/*" capture="environment”>
Gives only option 2 I want both options
23 replies
FFilament
Created by quantumleaps on 11/10/2024 in #❓┊help
disable or fix fileupload validation
it is a separate attribute, and not part of accept in the documentation. But when I use it as a separate attribute, it only gives option to click a picture on mobile devices. when used as a part of accept as the way I did, it gives option to either choose an existing picture or click one with camera
23 replies
FFilament
Created by quantumleaps on 11/10/2024 in #❓┊help
disable or fix fileupload validation
bump
23 replies