update ui and remove mock data
This commit is contained in:
@@ -1,24 +1,22 @@
|
||||
import 'server-only';
|
||||
import {readProfile} from '@/features/settings/mock/settings.mock';
|
||||
import type {MerchantProfile} from '@/features/settings/types/settings';
|
||||
|
||||
/**
|
||||
* The server-side half of the settings repository.
|
||||
* The merchant profile.
|
||||
*
|
||||
* Server Components can read data without an HTTP round trip, and a settings
|
||||
* form should: it has exactly one known state at page load, so fetching it
|
||||
* over the network from the same process that already has it would only add a
|
||||
* flash of empty inputs.
|
||||
* There is no business-profile resource in the platform contract — GET
|
||||
* /api/auth/me returns the signed-in USER (name, email, role, tenant), not the
|
||||
* company's GSTIN, timezone, currency or LYT accrual rate. The fixture that
|
||||
* used to answer this has been removed, so this returns null and the form
|
||||
* renders its unavailable state.
|
||||
*
|
||||
* What matters is that the PAGE does not import the fixture. It asks this
|
||||
* module, and this module is the single place that changes when the data comes
|
||||
* from Postgres or from an upstream service instead — exactly like its client
|
||||
* sibling, settingsRepository, which the same page's form saves through.
|
||||
* When the resource ships, this function is the only thing that changes.
|
||||
*
|
||||
* Async today only because every real implementation of it will be.
|
||||
* Required: GET/PATCH /api/settings/profile — business name, GSTIN, timezone,
|
||||
* currency, notification preferences.
|
||||
*/
|
||||
export const settingsServerRepository = {
|
||||
async getProfile(): Promise<MerchantProfile> {
|
||||
return readProfile();
|
||||
async getProfile(): Promise<MerchantProfile | null> {
|
||||
return null;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user