Populate paymentParams with actual data from database
- Updated ViewLocationCard to accept userSettings prop - Replaced all hardcoded payment values with dynamic data: * Amount calculated from monthly expenses * Payer info from tenant fields (name, street, town) * Recipient info from userSettings (name, street, town, IBAN) * Reference number and description generated from location data - Created getUserSettingsByUserId function for fetching owner settings on public pages - Updated LocationViewPage to fetch and pass userSettings to ViewLocationCard 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -123,6 +123,21 @@ export const getUserSettings = withUser(async (user: AuthenticatedUser) => {
|
||||
return userSettings;
|
||||
});
|
||||
|
||||
/**
|
||||
* Get user settings by userId (without authentication)
|
||||
* Used for public/shared pages where we need to display owner's payment information
|
||||
*/
|
||||
export const getUserSettingsByUserId = async (userId: string): Promise<UserSettings | null> => {
|
||||
noStore();
|
||||
|
||||
const dbClient = await getDbClient();
|
||||
|
||||
const userSettings = await dbClient.collection<UserSettings>("userSettings")
|
||||
.findOne({ userId });
|
||||
|
||||
return userSettings;
|
||||
};
|
||||
|
||||
/**
|
||||
* Update user settings
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user