chore: use strings for severities instead of numbers
Signed-off-by: Marek Libra <marek.libra@gmail.com>
This commit is contained in:
@@ -35,7 +35,7 @@ export type GetNotificationsOptions = {
|
||||
createdAfter?: Date;
|
||||
sort?: 'created' | 'topic' | 'origin';
|
||||
sortOrder?: 'asc' | 'desc';
|
||||
minimalSeverity?: NotificationSeverity;
|
||||
minimumSeverity?: NotificationSeverity;
|
||||
};
|
||||
|
||||
/** @public */
|
||||
|
||||
@@ -67,8 +67,8 @@ export class NotificationsClient implements NotificationsApi {
|
||||
if (options?.createdAfter !== undefined) {
|
||||
queryString.append('created_after', options.createdAfter.toISOString());
|
||||
}
|
||||
if (options?.minimalSeverity !== undefined) {
|
||||
queryString.append('minimal_severity', options.minimalSeverity);
|
||||
if (options?.minimumSeverity !== undefined) {
|
||||
queryString.append('minimal_severity', options.minimumSeverity);
|
||||
}
|
||||
const urlSegment = `?${queryString}`;
|
||||
|
||||
|
||||
@@ -251,12 +251,10 @@ export const NotificationsFilters = ({
|
||||
|
||||
<Grid item xs={12}>
|
||||
<FormControl fullWidth variant="outlined" size="small">
|
||||
<InputLabel id="notifications-filter-severity">
|
||||
Minimal severity
|
||||
</InputLabel>
|
||||
<InputLabel id="notifications-filter-severity">Severity</InputLabel>
|
||||
|
||||
<Select
|
||||
label="Minimal severity"
|
||||
label="Severity"
|
||||
labelId="notifications-filter-severity"
|
||||
value={severity}
|
||||
onChange={handleOnSeverityChanged}
|
||||
|
||||
@@ -46,8 +46,7 @@ export const NotificationsPage = () => {
|
||||
const [sorting, setSorting] = React.useState<SortBy>(
|
||||
SortByOptions.newest.sortBy,
|
||||
);
|
||||
const [severity, setSeverity] =
|
||||
React.useState<NotificationSeverity>('normal');
|
||||
const [severity, setSeverity] = React.useState<NotificationSeverity>('low');
|
||||
|
||||
const { error, value, retry, loading } = useNotificationsApi(
|
||||
api => {
|
||||
@@ -55,7 +54,7 @@ export const NotificationsPage = () => {
|
||||
search: containsText,
|
||||
limit: pageSize,
|
||||
offset: pageNumber * pageSize,
|
||||
minimalSeverity: severity,
|
||||
minimumSeverity: severity,
|
||||
...(sorting || {}),
|
||||
};
|
||||
if (unreadOnly !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user