Skip to content

Commit

Permalink
Fix creating new schema langauges not working
Browse files Browse the repository at this point in the history
Fixes #1280
  • Loading branch information
maxpatiiuk committed Apr 20, 2022
1 parent 7b68bcd commit 64095b7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions specifyweb/frontend/js_src/lib/components/schemaconfig.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { ajax, ping } from '../ajax';
import { ajax, Http, ping } from '../ajax';
import { serializeResource } from '../datamodelutils';
import { commonText } from '../localization/common';
import { fetchPickLists } from '../picklists';
Expand Down Expand Up @@ -233,10 +233,14 @@ export function SchemaConfig({
): Promise<unknown> =>
'resource_uri' in resource && resource.id >= 0
? saveResource(resource as CommonTableFields)
: ping('/api/specify/splocaleitemstr/', {
method: 'POST',
body: prepareNewString(resource as NewSpLocaleItemString),
});
: ping(
'/api/specify/splocaleitemstr/',
{
method: 'POST',
body: prepareNewString(resource as NewSpLocaleItemString),
},
{ expectedResponseCodes: [Http.CREATED] }
);

const saveResource = async (
resource: CommonTableFields
Expand Down

0 comments on commit 64095b7

Please sign in to comment.