mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Rename resourceExists to hasResource
The function was also moved to the smaller interface ResourceSet.
This commit is contained in:
@@ -42,7 +42,7 @@ export class PatchOperationHandler extends OperationHandler {
|
||||
// RFC7231, §4.3.4: If the target resource does not have a current representation and the
|
||||
// PUT successfully creates one, then the origin server MUST inform the
|
||||
// user agent by sending a 201 (Created) response.
|
||||
const exists = await this.store.resourceExists(operation.target, operation.conditions);
|
||||
const exists = await this.store.hasResource(operation.target);
|
||||
await this.store.modifyResource(operation.target, operation.body as Patch, operation.conditions);
|
||||
if (exists) {
|
||||
return new ResetResponseDescription();
|
||||
|
||||
@@ -38,7 +38,7 @@ export class PutOperationHandler extends OperationHandler {
|
||||
}
|
||||
// A more efficient approach would be to have the server return metadata indicating if a resource was new
|
||||
// See https://github.com/solid/community-server/issues/632
|
||||
const exists = await this.store.resourceExists(operation.target, operation.conditions);
|
||||
const exists = await this.store.hasResource(operation.target);
|
||||
await this.store.setRepresentation(operation.target, operation.body, operation.conditions);
|
||||
if (exists) {
|
||||
return new ResetResponseDescription();
|
||||
|
||||
Reference in New Issue
Block a user