Created
March 1, 2023 04:34
-
-
Save lomeat/2ddd1c626597304311cf036c02fe3858 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// GET /cities?city='qweqwe' | |
type CitiesReq = { | |
city: string; | |
}; | |
type CitiesRes = Array<{ | |
city: string; | |
country: string; | |
}>; | |
// POST /search | |
type searchReq = { | |
trip: { | |
from: string; | |
to: string; | |
}; | |
date: { | |
// ISO string | |
from: string; | |
to: string; | |
}; | |
count: number; | |
}; | |
// Either we get from post and put to store... | |
type searchRes = Array<{ | |
id: number; | |
title: string; | |
date: { | |
from: string; | |
to: string; | |
}; | |
}>; | |
// GET /filters | |
type filters = { | |
[k: string]: number[] | string[] | number | string | boolean; | |
}; | |
type filtersReq = {}; | |
type filtersRes = filters; | |
// POST /filters | |
type searchFiltersReq = { | |
token: string; | |
filters; | |
}; | |
type searchFiltersReq2 = searchReq & { | |
filters; | |
}; | |
// GET /results?token='qweqwe' | |
type ResultsReq = { | |
token: string; | |
}; | |
type ResultsReq2 = searchReq; | |
// ...or we make new request | |
type ResultsRes = searchRes; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment