stores login fix

This commit is contained in:
Suriya
2026-07-09 18:03:44 +05:30
parent 1437a08be5
commit 7e9b3f98ba
9 changed files with 653 additions and 29 deletions

View File

@@ -14,15 +14,17 @@ async function main() {
await client.connect();
console.log('Connected to PostgreSQL successfully!');
// Get Suriya Store locations
const locationsRes = await client.query('SELECT locationid, tenantid, locationname, email, contactno, status FROM tenantlocations WHERE tenantid = 1135');
console.log('\n--- SURIYA STORE LOCATIONS (tenantid = 1135) ---');
console.table(locationsRes.rows);
// Get all users associated with tenantid = 1135
const usersRes = await client.query('SELECT userid, authname, firstname, email, contactno, roleid, locationid, status FROM app_users WHERE tenantid = 1135');
console.log('\n--- USERS ASSOCIATED WITH tenantid = 1135 ---');
console.table(usersRes.rows);
const query = `
SELECT a.tenantcustomerid, a.customerid, a.tenantid, a.locationid,
b.tenantname, c.locationname
FROM tenantcustomers a
LEFT JOIN tenants b ON a.tenantid = b.tenantid
INNER JOIN tenantlocations c ON a.locationid = c.locationid
WHERE a.tenantid = 1135
`;
const res = await client.query(query);
console.log('\n--- Tenant Customers Links (tid = 1135) ---');
console.table(res.rows);
} catch (err) {
console.error('Error connecting:', err);