数据库文档编写,开发规范文档,数据库接入
This commit is contained in:
@@ -11,8 +11,19 @@ export type MarketTrendsData = {
|
||||
endIso: string
|
||||
}
|
||||
|
||||
export async function fetchMarketTrends(period: string): Promise<MarketTrendsData> {
|
||||
const { startIso, endIso } = computeDateRange(period)
|
||||
export async function fetchMarketTrends(period: string, range?: { start: string; end: string } | null): Promise<MarketTrendsData> {
|
||||
let startIso: string;
|
||||
let endIso: string;
|
||||
|
||||
if (range != null && range.start && range.end) {
|
||||
startIso = range.start;
|
||||
endIso = range.end;
|
||||
} else {
|
||||
const computedRange = computeDateRange(period)
|
||||
startIso = computedRange.startIso
|
||||
endIso = computedRange.endIso
|
||||
}
|
||||
|
||||
const startDate = toDateOnly(startIso)
|
||||
const endDate = toDateOnly(endIso)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user