Skip to content

Commit

Permalink
fix(ui): set first segment in list as selected (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-bre committed Jul 21, 2023
1 parent f5b074d commit ccd202a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ app.use(passport.session());

app.use(
cors({
origin: keys.CLIENT_HOME_PAGE_URL,
origin: true,
methods: "GET,HEAD,PUT,PATCH,POST,DELETE",
credentials: true // allow session cookie from browser to pass through
}));
Expand Down
6 changes: 3 additions & 3 deletions packages/api/src/routes/sdkRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const sdkRoutesWrapper = (storeManager: Promise<dbManager.DataStoreManage
const flag = await flagsService.getFlag({key: flagKey});

if (!flag) {
res.status(404).json({
res.json({
user: req.user,
error: SdkResponseCodes.FlagNotFound
});
Expand All @@ -48,13 +48,13 @@ export const sdkRoutesWrapper = (storeManager: Promise<dbManager.DataStoreManage

const resp = await sdkService.evaluateFlag(flag, flagContext, correlationId);

res.status(200).json({
res.json({
user: req.user,
data: resp
});

} catch (error) {
res.status(500).json({
res.json({
user: req.user,
error: SdkResponseCodes.GenericError
});
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/flags/RulesBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const RulesBoard: React.FC<RulesBoardProps> = (props) => {
});

setSegments(allSegments);

setSelectedSegment(allSegments[0]);
setLoading(false);
}).catch(ex => { console.log(ex); });
}, []);
Expand Down

0 comments on commit ccd202a

Please sign in to comment.