Skip to content

Commit

Permalink
Merge pull request #433 from Esri/doc/408
Browse files Browse the repository at this point in the history
docs: make it clearer that it takes two steps to create a feature service
  • Loading branch information
john gravois committed Jan 15, 2019
2 parents 2da07d3 + ca306cd commit 88bf26b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 3 additions & 4 deletions packages/arcgis-rest-feature-service-admin/src/addTo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
/* Copyright (c) 2018-2019 Environmental Systems Research Institute, Inc.
* Apache-2.0 */

import { request, cleanUrl } from "@esri/arcgis-rest-request";
Expand Down Expand Up @@ -42,7 +42,7 @@ export interface IAddToServiceDefinitionResult {
* tables: []
* });
* ```
* Add layer(s) and/or table(s) to a hosted feature service.
* Add layer(s) and/or table(s) to a hosted feature service. See the [REST Documentation](https://developers.arcgis.com/rest/services-reference/add-to-definition-feature-service-.htm) for more information.
*
* @param url - URL of feature service
* @param requestOptions - Options for the request
Expand All @@ -54,8 +54,7 @@ export function addToServiceDefinition(
requestOptions: IAddToServiceDefinitionRequestOptions
): Promise<IAddToServiceDefinitionResult> {
const adminUrl =
cleanUrl(url).replace("/rest/services", "/rest/admin/services") +
"/addToDefinition";
`${cleanUrl(url).replace(`/rest/services`, `/rest/admin/services`)}/addToDefinition`;

requestOptions.params = {
addToDefinition: {},
Expand Down
9 changes: 6 additions & 3 deletions packages/arcgis-rest-feature-service-admin/src/create.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
/* Copyright (c) 2018-2019 Environmental Systems Research Institute, Inc.
* Apache-2.0 */

import { request, getPortalUrl } from "@esri/arcgis-rest-request";
Expand Down Expand Up @@ -146,7 +146,10 @@ export interface ICreateServiceResult {

/**
* ```js
* import { createFeatureService } from '@esri/arcgis-rest-feature-service-admin';
* import {
* createFeatureService,
* addToServiceDefinition
* } from '@esri/arcgis-rest-feature-service-admin';
* //
* createFeatureService({
* authentication: userSession,
Expand All @@ -156,7 +159,7 @@ export interface ICreateServiceResult {
* }
* });
* ```
* Create a new hosted feature service.
* Create a new [hosted feature service](https://developers.arcgis.com/rest/users-groups-and-items/create-service.htm). After the service has been created, call [`addToServiceDefinition()`](../addToServiceDefinition/) if you'd like to update it's schema.
* @param requestOptions - Options for the request
* @returns A Promise that resolves with service details once the service has been created
*/
Expand Down

0 comments on commit 88bf26b

Please sign in to comment.