Sanjeet Kedia
CCConvex Community
•Created by Sanjeet Kedia on 11/9/2023 in #support-community
How to get the type of a convex function return in react
Also i am having difficulites making joints in convex
5 replies
CCConvex Community
•Created by Sanjeet Kedia on 10/4/2023 in #support-community
Pay as you go
So far it is working but the 25usd seems like a big deal in mu head 😂
4 replies
CCConvex Community
•Created by Sanjeet Kedia on 10/4/2023 in #support-community
Having to put v.optional in the schema file
I deleted all the data and it works
20 replies
CCConvex Community
•Created by Sanjeet Kedia on 10/4/2023 in #support-community
Having to put v.optional in the schema file
I think i found the issue, i had previous data existing in the table which was messing with my schmea
20 replies
CCConvex Community
•Created by Sanjeet Kedia on 10/4/2023 in #support-community
Having to put v.optional in the schema file
definetly impoved my code repairability
20 replies
CCConvex Community
•Created by Sanjeet Kedia on 10/4/2023 in #support-community
Having to put v.optional in the schema file
IDK what happened, but it is working now, thanks alot for the tip about the destructuring i will try to look out for more of those in the future
20 replies
CCConvex Community
•Created by Sanjeet Kedia on 10/4/2023 in #support-community
Having to put v.optional in the schema file
when i remove the v.optional
20 replies
CCConvex Community
•Created by Sanjeet Kedia on 10/4/2023 in #support-community
Having to put v.optional in the schema file
This is the error in my console
20 replies
CCConvex Community
•Created by Sanjeet Kedia on 10/4/2023 in #support-community
Having to put v.optional in the schema file

20 replies
CCConvex Community
•Created by Sanjeet Kedia on 10/4/2023 in #support-community
Having to put v.optional in the schema file
so i tried returning the invoiceID from the function it returns null, but when i put v.optional it all works
20 replies
CCConvex Community
•Created by Sanjeet Kedia on 10/4/2023 in #support-community
Having to put v.optional in the schema file
in the salesSpecifrication table if i dont put v.optional it shows error in the console when i do npx convex dev
20 replies
CCConvex Community
•Created by Sanjeet Kedia on 10/4/2023 in #support-community
Having to put v.optional in the schema file
This is my schema.ts file
20 replies
CCConvex Community
•Created by Sanjeet Kedia on 10/4/2023 in #support-community
Having to put v.optional in the schema file
import { defineSchema, defineTable } from 'convex/server';
import { v } from 'convex/values';
export default defineSchema({
invoiceList: defineTable({
invoiceNo: v.number(),
invoiceDate: v.string(),
customerName: v.string(),
customerAddress: v.string(),
customerEmail: v.string(),
customerPhone: v.string(),
total: v.number(),
discount: v.number(),
advance: v.number(),
balance: v.number(),
}),
salesSpecification: defineTable({
rowNo: v.number(),
invoiceId: v.optional(v.id('invoiceList')),
itemName: v.string(),
unitPrice: v.number(),
qty: v.number(),
subTotal: v.number(),
}),
itemList: defineTable({
itemName: v.string(),
itemCode: v.string(),
dollarPrice: v.number(),
}),
customerList: defineTable({
customerName: v.string(),
customerAddress: v.string(),
customerEmail: v.string(),
customerPhone: v.string(),
}),
appState: defineTable({
dollarRate: v.number(),
}),
});
20 replies
CCConvex Community
•Created by Sanjeet Kedia on 10/4/2023 in #support-community
Having to put v.optional in the schema file
Is this an example of the circular error, i only need the salesSpecification to hold the invoiceNo i don't need to store the sales spec Id in Invoice List Table
20 replies
CCConvex Community
•Created by Sanjeet Kedia on 10/4/2023 in #support-community
Having to put v.optional in the schema file
This is my code, there was error i was getting null until i changed the schma of my salesspecification table to v.optional(v.id())
20 replies
CCConvex Community
•Created by Sanjeet Kedia on 10/4/2023 in #support-community
Having to put v.optional in the schema file
import { mutation } from './_generated/server';
import { v } from 'convex/values';
export const addNewInvoice = mutation({
args: {
advance: v.number(),
balance: v.number(),
customerAddress: v.string(),
customerEmail: v.string(),
customerName: v.string(),
customerPhone: v.string(),
discount: v.number(),
invoiceDate: v.string(),
total: v.number(),
invoiceNo: v.number(),
itemRows: v.array(
v.object({
invoiceItemRow: v.number(),
itemName: v.string(),
itemPrice: v.number(),
itemQty: v.number(),
subTotal: v.number(),
}),
),
},
handler: async (ctx, args) => {
const newInvoiceId = await ctx.db.insert('invoiceList', {
advance: args.advance,
balance: args.balance,
customerAddress: args.customerAddress,
customerEmail: args.customerEmail,
customerName: args.customerName,
customerPhone: args.customerPhone,
discount: args.discount,
invoiceDate: args.invoiceDate,
total: args.total,
invoiceNo: args.invoiceNo,
});
for (let i = 0; i < args.itemRows.length; i++) {
const row = args.itemRows[i];
const SalesSpecId = await ctx.db.insert('salesSpecification', {
itemName: row.itemName,
qty: row.itemQty,
rowNo: row.invoiceItemRow,
subTotal: row.subTotal,
unitPrice: row.itemPrice,
invoiceId: newInvoiceId,
});
}
return typeof newInvoiceId;
},
});
20 replies
CCConvex Community
•Created by Sanjeet Kedia on 9/24/2023 in #support-community
development with electron js
Is there any way to use the react way because i am using react in electron? The documentation on http client is not very clear
4 replies